Major infrastructure changes, part 2.

* Moved helpers, common and triggers dirs into xbps-src, where
  they belong.
* Renamed the templates dir to srcpkgs, it was so redundant before.
* Make it possible to add subpkgs with no restriction in names, for
  example udev now has a subpkgs called "libgudev". Previously
  subpkgs were named "${sourcepkg}-${pkgname}".
* xbps-src: changed to look for template files in current directory.
  That means that most arguments from the targets have been removed.
* xbps-src: added a reinstall target, to remove + install.
* xbps-src: do not overwrite binpkgs by default, skip them.

And more that I forgot because it's a mega-commit that I've been
working for some days already...

--HG--
extra : convert_revision : 0f466878584d1e6895d2a234f07ea1b2d1e61b3e
This commit is contained in:
Juan RP 2009-11-22 08:31:44 +01:00
parent 3c58e3ad40
commit 85cc462e1d
1305 changed files with 719 additions and 654 deletions

View File

@ -1,17 +0,0 @@
# Toplevel Makefile
#
.PHONY: all
all:
$(MAKE) -C xbps-src
.PHONY: install
install:
$(MAKE) -C xbps-src install
.PHONY: uninstall
uninstall:
$(MAKE) -C xbps-src uninstall
.PHONY: clean
clean:
$(MAKE) -C xbps-src clean

165
README
View File

@ -1,48 +1,74 @@
------------------------------------------------------------------------------ xbps-src - building packages from source
REQUIREMENTS ========================================
------------------------------------------------------------------------------
What is it?
-----------
`xbps-src` is the utility used by the _X binary package system_ to build
binary packages from source distribution files. A root directory `srcpkgs`
contains multiple subdirs, each one to build a package as its name
indicates. The following example illustrates it:
+
+
.................................
xbps-templates/
|
|----- srcpkgs/
|
|----- binutils/
|----- gcc/
|----- glibc/
|----- ....
..................................
Requirements
------------
The following software is required in the host system to build XBPS The following software is required in the host system to build XBPS
binary packages: binary packages from source:
* GNU awk - GNU awk
* GNU bash - GNU bash
* GNU bison - GNU bison
* GNU gcc c++ (development package) - GNU gcc c++ (development package)
* GNU gettext (development package) - GNU gettext (development package)
* GNU make - GNU make
* GNU patch - GNU patch
* GNU texinfo - GNU texinfo
* fakeroot - fakeroot
* perl - perl
* sudo - sudo
Run "make install clean" at the top level directory, xbps-src and `xbps-src` and its shell utilities need to be installed in a directory
its shell utilities will be installed into /usr/local by default (can be for correct operation, that is accomplished by issuing:
changed by setting PREFIX and DESTDIR). -----------------------------------
$ cd xbps-src && make install clean
-----------------------------------
DONT FORGET TO EDIT "$PREFIX/etc/xbps-src.conf" BEFORE USING IT! This will install all files into `/usr/local` by default, can be changed
by specifying `PREFIX` and `DESTDIR` to make(1).
------------------------------------------------------------------------------ Building packages from source
HOW TO BUILD/HANDLE PACKAGES FROM SOURCE -----------------------------
------------------------------------------------------------------------------ `xbps-src` always look for a `template` file in current directory, that's what
it specifies the package build definitions and such. The build templates
Before using xbps-src, some required utilities need to be built and installed are located in the `srcpkgs` directory, you should change the cwd to the
into $(PREFIX); by default they are installed into /usr/local. directory matching the package that you want to work on, i.e for binutils,
You can do this by issuing "make" and "make install" as root in the top its directory is `srcpkgs/binutils`.
level directory. +
If configuration file is not specified from the command line with the If configuration file is not specified from the command line with the
-c flag, it will first try to use the default location at -c flag, it will first try to use the default location at
/usr/local/etc/xbps-src.conf (or the installation prefix that was specified `/usr/local/etc/xbps-src.conf` (or the installation prefix that was specified
to the make(1) command), and as last resort in the etc directory of the to the make(1) command), and as last resort in the etc directory of the
current directory. current directory.
+
To avoid problems with libtool and configure scripts finding stuff that is To avoid problems with libtool and configure scripts finding stuff that is
available in the host system, almost all packages must be built inside of a available in the host system, almost all packages must be built inside of a
chroot. So the first thing would be to create the binary packages with: chroot. So the first thing would be to create the required set of packages
that will be used in the chroot:
$ xbps-src install xbps-base-chroot -------------------------------------------------
$ cd srcpkgs/xbps-base-chroot && xbps-src install
-------------------------------------------------
This will build all required packages via fakeroot in masterdir, therefore you This will build all required packages via fakeroot in masterdir, therefore you
can run it as normal user. Next commands will require super-user privileges can run it as normal user. Next commands will require super-user privileges
@ -52,65 +78,78 @@ be that xbps packages are meant to be used in a system and not just for
ordinary users. So once all packages are built, you can create and enter ordinary users. So once all packages are built, you can create and enter
to the chroot with: to the chroot with:
$ sudo xbps-src chroot ----------------------
$ sudo xbps-src chroot
----------------------
Press Control + D to exit from the chroot. The following targets will require Press Control + D to exit from the chroot. The following targets will require
to be done in the chroot: to be done in the chroot (_once xbps-base-chroot is installed_):
*build, configure, install, install-destdir, remove, stow and unstow*
build, configure, install, install-destdir, remove, stow and unstow. +
Now let's explain some more about the targets that you can use. To start Now let's explain some more about the targets that you can use. To start
installing packages you should use the install target: installing packages you should use the install target, all source packages
are located in the `srcpkgs` directory, so to install glib:
$ sudo xbps-src install glib ------------------------------------------
$ cd srcpkgs/glib && sudo xbps-src install
------------------------------------------
If the package is properly installed, it will be "stowned" automatically. If the package is properly installed, it will be "stowned" automatically.
``stowned'' means that this package is available in the master directory, ``stowned'' means that this package is available in the master directory,
on which xpbs has copied all files from DESTDIR/<pkgname>. on which xpbs has copied all files from DESTDIR/<pkgname>.
+
To remove a currently installed (and stowned) package, you can use: To remove a currently installed (and stowned) package, you can use:
-----------------------------------------
$ sudo xbps-src remove glib $ cd srcpkgs/glib && sudo xbps-src remove
-----------------------------------------
Please note that when you remove it, the package will also be removed Please note that when you remove it, the package will also be removed
from XBPS_DESTDIR and previously "unstowned". from XBPS_DESTDIR and previously `unstowned`.
+
To stow an already installed package (from XBPS_DESTDIR/<pkgname>): To stow an already installed package (from XBPS_DESTDIR/<pkgname>):
---------------------------------------
$ cd srcpkgs/glib && sudo xbps-src stow
---------------------------------------
$ sudo xbps-src stow glib To unstow an already installed (stowned) package:
-----------------------------------------
and to unstow an already installed (stowned) package: $ cd srcpkgs/glib && sudo xbps-src unstow
-----------------------------------------
$ sudo xbps-src unstow glib
You can also print some stuff about any template build file, e.g: You can also print some stuff about any template build file, e.g:
----------------------------------
$ xbps-src info glib $ cd srcpkgs/glib && xbps-src info
----------------------------------
To list installed (stowned) packages, use this: To list installed (stowned) packages, use this:
---------------
$ xbps-src list $ xbps-src list
---------------
To only extract the distfiles, without configuring/building/installing: To only extract the distfiles, without configuring/building/installing:
------------------------------------
$ xbps-src extract foo $ cd srcpkgs/foo && xbps-src extract
------------------------------------
To not remove the build directory after successful installation: To not remove the build directory after successful installation:
---------------------------------------------
$ sudo xbps-src -C install blah $ cd srcpkgs/blah && sudo xbps-src -C install
---------------------------------------------
To only fetch the distfile: To only fetch the distfile:
-----------------------------------
$ xbps-src fetch blah $ cd srcpkgs/blah && xbps-src fetch
-----------------------------------
To only install the package, _without_ stowning it into the master directory: To only install the package, _without_ stowning it into the master directory:
--------------------------------------------------
$ sudo xbps-src install-destdir blob $ cd srcpkgs/blob && sudo xbps-src install-destdir
--------------------------------------------------
To list files installed by a package, note that package must be installed To list files installed by a package, note that package must be installed
into destination directory first: into destination directory first:
----------------------------
$ xbps-src listfiles blob $ xbps-src listfiles pkgname
----------------------------
------------------------------------------------------------------------------
Juan Romero Pardines <xtraeme@gmail.com>

6
TODO
View File

@ -1,6 +0,0 @@
* Add a trigger for fc-cache.
* Add a trigger to (un)register users/groups. Currently packages that
require user/groups use custom INSTALL/REMOVE scripts, which adds
a lot of duplicated work.
* Support external remote patches.
* Add the following packages: mercurial, vala.

View File

@ -16,7 +16,7 @@ long_desc="
conf_files="/etc/dbus-1/system.d/ConsoleKit.conf conf_files="/etc/dbus-1/system.d/ConsoleKit.conf
/etc/ConsoleKit/seats.d/00-primary.seat" /etc/ConsoleKit/seats.d/00-primary.seat"
subpackages="devel x11" subpackages="$pkgname-devel $pkgname-x11"
Add_dependency full glibc Add_dependency full glibc
Add_dependency full dbus Add_dependency full dbus
Add_dependency full dbus-glib Add_dependency full dbus-glib

View File

@ -15,7 +15,7 @@ long_desc="
conf_files="/etc/dbus-1/system.d/org.gnome.GConf.Defaults.conf conf_files="/etc/dbus-1/system.d/org.gnome.GConf.Defaults.conf
/etc/gconf/2/path" /etc/gconf/2/path"
subpackages="devel" subpackages="$pkgname-devel"
Add_dependency build pkg-config Add_dependency build pkg-config
Add_dependency build intltool Add_dependency build intltool
Add_dependency full glibc Add_dependency full glibc

View File

@ -2,6 +2,7 @@
pkgname=ImageMagick pkgname=ImageMagick
_distver=6.5.6 _distver=6.5.6
_distverpatch=10 _distverpatch=10
revision=1
version=${_distver}.${_distverpatch} version=${_distver}.${_distverpatch}
wrksrc=${pkgname}-${_distver}-${_distverpatch} wrksrc=${pkgname}-${_distver}-${_distverpatch}
distfiles="ftp://ftp.imagemagick.org/pub/$pkgname/$pkgname-${_distver}-${_distverpatch}.tar.bz2" distfiles="ftp://ftp.imagemagick.org/pub/$pkgname/$pkgname-${_distver}-${_distverpatch}.tar.bz2"
@ -46,6 +47,6 @@ Add_dependency full libxml2
Add_dependency full cairo Add_dependency full cairo
Add_dependency full librsvg Add_dependency full librsvg
Add_dependency full libX11 Add_dependency full libX11
Add_dependency run libtool-ltdl Add_dependency run libltdl
Add_dependency run gcc-libgomp Add_dependency run libgomp
Add_dependency run gcc-libstdc++ Add_dependency run libstdc++

View File

@ -1,6 +1,7 @@
# Template build file for 'MesaLib'. # Template build file for 'MesaLib'.
pkgname=MesaLib pkgname=MesaLib
version=7.6 version=7.6
revision=1
wrksrc="Mesa-$version" wrksrc="Mesa-$version"
distfiles="ftp://ftp.freedesktop.org/pub/mesa/$version/$pkgname-$version.tar.bz2" distfiles="ftp://ftp.freedesktop.org/pub/mesa/$version/$pkgname-$version.tar.bz2"
build_style=gnu_configure build_style=gnu_configure
@ -15,7 +16,7 @@ long_desc="
Inc. However, the author makes no claim that Mesa is in any way a Inc. However, the author makes no claim that Mesa is in any way a
compatible replacement for OpenGL or associated with Silicon Graphics, Inc." compatible replacement for OpenGL or associated with Silicon Graphics, Inc."
subpackages="devel" subpackages="$pkgname-devel"
Add_dependency build pkg-config Add_dependency build pkg-config
Add_dependency build glproto Add_dependency build glproto
Add_dependency build dri2proto ">=2.1" Add_dependency build dri2proto ">=2.1"
@ -31,4 +32,4 @@ Add_dependency full libXi
Add_dependency full libXfixes Add_dependency full libXfixes
Add_dependency full libXdamage Add_dependency full libXdamage
Add_dependency full libXxf86vm Add_dependency full libXxf86vm
Add_dependency run gcc-libstdc++ Add_dependency run libstdc++

View File

@ -16,7 +16,7 @@ long_desc="
engineered for the desktop workstation environment, with a focus on engineered for the desktop workstation environment, with a focus on
performance, low resource usage, and security." performance, low resource usage, and security."
subpackages="devel" subpackages="$pkgname-devel"
Add_dependency build pkg-config Add_dependency build pkg-config
Add_dependency full glibc Add_dependency full glibc
Add_dependency full glib Add_dependency full glib

View File

@ -14,9 +14,9 @@ long_desc="
conf_files="/etc/PolicyKit/PolicyKit.conf conf_files="/etc/PolicyKit/PolicyKit.conf
/etc/dbus-1/system.d/org.freedesktop.PolicyKit.conf" /etc/dbus-1/system.d/org.freedesktop.PolicyKit.conf"
keep_empty_dirs=yes keep_empty_dirs=yes
subpackages="devel"
subpackages="$pkgname-devel"
Add_dependency full glibc Add_dependency full glibc
Add_dependency full dbus Add_dependency full dbus
Add_dependency full dbus-glib Add_dependency full dbus-glib

View File

@ -18,7 +18,7 @@ long_desc="
gtk_iconcache_dirs="/usr/share/icons/hicolor" gtk_iconcache_dirs="/usr/share/icons/hicolor"
triggers="gtk-icon-cache" triggers="gtk-icon-cache"
subpackages="devel" subpackages="$pkgname-devel"
Add_dependency build pkg-config Add_dependency build pkg-config
Add_dependency build intltool Add_dependency build intltool
Add_dependency full glibc Add_dependency full glibc

View File

@ -14,7 +14,7 @@ long_desc="
filesystems." filesystems."
keep_libtool_archives=yes keep_libtool_archives=yes
subpackages="devel progs" subpackages="acl-devel acl-progs"
Add_dependency build gettext Add_dependency build gettext
Add_dependency build gawk Add_dependency build gawk
Add_dependency run glibc Add_dependency run glibc

View File

@ -1,6 +1,7 @@
# Template file for 'adobe-flash-plugin' # Template file for 'adobe-flash-plugin'
pkgname=adobe-flash-plugin pkgname=adobe-flash-plugin
version=10.1beta version=10.1beta
revision=1
# The EULA file # The EULA file
_eula="http://www.adobe.com/products/eulas/pdfs/Reader_Player_WWEULA-Combined-20060724_1430.pdf" _eula="http://www.adobe.com/products/eulas/pdfs/Reader_Player_WWEULA-Combined-20060724_1430.pdf"
_eulacksum=986c3ddacfee18946fbef7b76485922f8f36e61f790776ce82a87afff3008427 _eulacksum=986c3ddacfee18946fbef7b76485922f8f36e61f790776ce82a87afff3008427
@ -25,7 +26,7 @@ long_desc="
# Direct requirements as per objdump -p. # Direct requirements as per objdump -p.
Add_dependency run glibc Add_dependency run glibc
Add_dependency run gcc-libstdc++ Add_dependency run libstdc++
Add_dependency full libX11 Add_dependency full libX11
Add_dependency full libXext Add_dependency full libXext
Add_dependency full libXt Add_dependency full libXt

View File

@ -14,6 +14,6 @@ long_desc="
programming and provide higher level functionality as well as support for programming and provide higher level functionality as well as support for
the older OSS API, providing binary compatibility for most OSS programs." the older OSS API, providing binary compatibility for most OSS programs."
subpackages="devel" subpackages="$pkgname-devel"
Add_dependency build pkg-config Add_dependency build pkg-config
Add_dependency full glibc Add_dependency full glibc

View File

@ -13,7 +13,6 @@ do_install()
mkdir -p ${DESTDIR}/usr/share/info ${DESTDIR}/usr/share/man/man1 mkdir -p ${DESTDIR}/usr/share/info ${DESTDIR}/usr/share/man/man1
mv ${SRCPKGDESTDIR}/usr/include ${DESTDIR}/usr mv ${SRCPKGDESTDIR}/usr/include ${DESTDIR}/usr
mv ${SRCPKGDESTDIR}/usr/lib/lib*.*a ${DESTDIR}/usr/lib
mv ${SRCPKGDESTDIR}/usr/lib/lib*.so ${DESTDIR}/usr/lib mv ${SRCPKGDESTDIR}/usr/lib/lib*.so ${DESTDIR}/usr/lib
mv ${SRCPKGDESTDIR}/usr/bin/pspell-config ${DESTDIR}/usr/bin mv ${SRCPKGDESTDIR}/usr/bin/pspell-config ${DESTDIR}/usr/bin
mv ${SRCPKGDESTDIR}/usr/share/info/aspell-dev* \ mv ${SRCPKGDESTDIR}/usr/share/info/aspell-dev* \

View File

@ -1,6 +1,7 @@
# Template file for 'aspell' # Template file for 'aspell'
pkgname=aspell pkgname=aspell
version=0.60.6 version=0.60.6
revision=1
distfiles="ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${version}.tar.gz" distfiles="ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${version}.tar.gz"
build_style=gnu_configure build_style=gnu_configure
configure_args="--enable-compile-in-filters" configure_args="--enable-compile-in-filters"
@ -18,8 +19,8 @@ long_desc="
process is open at once." process is open at once."
# XXX Add missing ncursesw dependency. # XXX Add missing ncursesw dependency.
subpackages="devel" subpackages="$pkgname-devel"
Add_dependency full glibc Add_dependency full glibc
Add_dependency full ncurses Add_dependency full ncurses
Add_dependency full perl Add_dependency full perl
Add_dependency run gcc-libstdc++ Add_dependency run libstdc++

View File

@ -18,7 +18,7 @@ long_desc="
It also provides interfaces which an application can use to provide It also provides interfaces which an application can use to provide
additional accessibility information to assistive technology tools." additional accessibility information to assistive technology tools."
subpackages="devel" subpackages="$pkgname-devel"
Add_dependency build pkg-config Add_dependency build pkg-config
Add_dependency full glibc Add_dependency full glibc
Add_dependency full glib Add_dependency full glib

View File

@ -13,7 +13,7 @@ long_desc="
This package includes Extended attribute support library for ACL support." This package includes Extended attribute support library for ACL support."
keep_libtool_archives=yes keep_libtool_archives=yes
subpackages="devel progs" subpackages="attr-devel attr-progs"
Add_dependency build gettext Add_dependency build gettext
Add_dependency build gawk Add_dependency build gawk
Add_dependency run glibc Add_dependency run glibc

View File

@ -16,5 +16,5 @@ long_desc="
A vocabulary to formulate new pixel formats from existing primitives is A vocabulary to formulate new pixel formats from existing primitives is
provided as well as the framework to add new color models and data types." provided as well as the framework to add new color models and data types."
subpackages="devel" subpackages="$pkgname-devel"
Add_dependency run glibc Add_dependency run glibc

View File

@ -23,7 +23,7 @@ long_desc="
and other tools." and other tools."
base_chroot=yes base_chroot=yes
subpackages="devel" subpackages="$pkgname-devel"
Add_dependency run glibc Add_dependency run glibc
pre_install() pre_install()

View File

@ -26,5 +26,5 @@ Add_dependency full glibc
pre_build() pre_build()
{ {
cp -f ${XBPS_TEMPLATESDIR}/${pkgname}/dotconfig ${wrksrc}/.config cp -f ${FILESDIR}/dotconfig ${wrksrc}/.config
} }

View File

@ -24,6 +24,5 @@ long_desc="
predecessor, bzip (.bz)." predecessor, bzip (.bz)."
base_chroot=yes base_chroot=yes
subpackages="devel" subpackages="bzip2-devel"
Add_dependency run glibc Add_dependency run glibc

Some files were not shown because too many files have changed in this diff Show More