Skip to content

Commit

Permalink
Add make rule for building Arch Linux packages
Browse files Browse the repository at this point in the history
Added the necessary build infrastructure for building packages
compatible with the Arch Linux distribution. As such, one can now run:

    $ ./configure
    $ make pkg     # Alternatively, one can run 'make arch' as well

on the Arch Linux machine to create two binary packages compatible with
the pacman package manager, one for the zfs userland utilities and
another for the zfs kernel modules. The new packages can then be
installed by running:

    # pacman -U $package.pkg.tar.xz

In addition, source-only packages suitable for an Arch Linux chroot
environment or remote builder can also be build using the 'sarch' make
rule.

NOTE: Since the source dist tarball is created on the fly from the head
of the build tree, it's MD5 hash signature will be continually influx.
As a result, the md5sum variable was intentionally omitted from the
PKGBUILD files, and the '--skipinteg' makepkg option is used. This may
or may not have any serious security implications, as the source tarball
is not being downloaded from an outside source.

Signed-off-by: Prakash Surya <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#491
  • Loading branch information
Prakash Surya authored and behlendorf committed Dec 15, 2011
1 parent a38718a commit 6ba3b44
Show file tree
Hide file tree
Showing 61 changed files with 589 additions and 21 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include $(top_srcdir)/config/rpm.am
include $(top_srcdir)/config/deb.am
include $(top_srcdir)/config/tgz.am
include $(top_srcdir)/config/arch.am

if CONFIG_USER
USER_DIR = dracut udev etc man scripts lib cmd
Expand Down
65 changes: 59 additions & 6 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@

@SET_MAKE@

###############################################################################
# Written by Prakash Surya <[email protected]>
###############################################################################
# Build targets for RPM packages.
###############################################################################

VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
Expand All @@ -37,11 +43,13 @@ host_triplet = @host@
target_triplet = @target@
DIST_COMMON = $(am__configure_deps) $(noinst_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/PKGBUILD-zfs-modules.in $(srcdir)/PKGBUILD-zfs.in \
$(srcdir)/zfs-modules.spec.in \
$(srcdir)/zfs-script-config.sh.in $(srcdir)/zfs.spec.in \
$(srcdir)/zfs_config.h.in $(top_srcdir)/config/deb.am \
$(top_srcdir)/config/rpm.am $(top_srcdir)/config/tgz.am \
$(top_srcdir)/configure $(top_srcdir)/module/Makefile.in \
$(srcdir)/zfs_config.h.in $(top_srcdir)/config/arch.am \
$(top_srcdir)/config/deb.am $(top_srcdir)/config/rpm.am \
$(top_srcdir)/config/tgz.am $(top_srcdir)/configure \
$(top_srcdir)/module/Makefile.in \
$(top_srcdir)/module/avl/Makefile.in \
$(top_srcdir)/module/nvpair/Makefile.in \
$(top_srcdir)/module/unicode/Makefile.in \
Expand Down Expand Up @@ -106,8 +114,8 @@ CONFIG_HEADER = zfs_config.h
CONFIG_CLEAN_FILES = module/Makefile module/avl/Makefile \
module/nvpair/Makefile module/unicode/Makefile \
module/zcommon/Makefile module/zfs/Makefile \
module/zpios/Makefile zfs.spec zfs-modules.spec \
zfs-script-config.sh
module/zpios/Makefile zfs.spec zfs-modules.spec PKGBUILD-zfs \
PKGBUILD-zfs-modules zfs-script-config.sh
CONFIG_CLEAN_VPATH_FILES =
AM_V_GEN = $(am__v_GEN_$(V))
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
Expand Down Expand Up @@ -212,6 +220,8 @@ GREP = @GREP@
HAVE_ALIEN = @HAVE_ALIEN@
HAVE_DPKG = @HAVE_DPKG@
HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
HAVE_MAKEPKG = @HAVE_MAKEPKG@
HAVE_PACMAN = @HAVE_PACMAN@
HAVE_RPM = @HAVE_RPM@
HAVE_RPMBUILD = @HAVE_RPMBUILD@
INSTALL = @INSTALL@
Expand All @@ -238,6 +248,8 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAKEPKG = @MAKEPKG@
MAKEPKG_VERSION = @MAKEPKG_VERSION@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
Expand All @@ -252,6 +264,8 @@ PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PACMAN = @PACMAN@
PACMAN_VERSION = @PACMAN_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
RPM = @RPM@
Expand Down Expand Up @@ -354,7 +368,7 @@ all: zfs_config.h
.SUFFIXES:
am--refresh:
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/rpm.am $(top_srcdir)/config/deb.am $(top_srcdir)/config/tgz.am $(am__configure_deps)
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/rpm.am $(top_srcdir)/config/deb.am $(top_srcdir)/config/tgz.am $(top_srcdir)/config/arch.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
Expand Down Expand Up @@ -421,6 +435,10 @@ zfs.spec: $(top_builddir)/config.status $(srcdir)/zfs.spec.in
cd $(top_builddir) && $(SHELL) ./config.status $@
zfs-modules.spec: $(top_builddir)/config.status $(srcdir)/zfs-modules.spec.in
cd $(top_builddir) && $(SHELL) ./config.status $@
PKGBUILD-zfs: $(top_builddir)/config.status $(srcdir)/PKGBUILD-zfs.in
cd $(top_builddir) && $(SHELL) ./config.status $@
PKGBUILD-zfs-modules: $(top_builddir)/config.status $(srcdir)/PKGBUILD-zfs-modules.in
cd $(top_builddir) && $(SHELL) ./config.status $@
zfs-script-config.sh: $(top_builddir)/config.status $(srcdir)/zfs-script-config.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $@

Expand Down Expand Up @@ -1004,6 +1022,41 @@ tgz-utils: tgz-local rpm-utils

tgz: tgz-modules tgz-utils

sarch-modules:
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" sarch-common

sarch-utils:
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" sarch-common

sarch: sarch-modules sarch-utils

arch-modules:
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" arch-common

arch-utils:
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" arch-common

arch: arch-modules arch-utils

arch-local:
@(if test "${HAVE_MAKEPKG}" = "no"; then \
echo -e "\n" \
"*** Required util ${MAKEPKG} missing. Please install the\n" \
"*** package for your distribution which provides ${MAKEPKG},\n" \
"*** re-run configure, and try again.\n"; \
exit 1; \
fi;)

sarch-common: dist
pkgbuild=PKGBUILD-$(pkg); \
$(MAKE) $(AM_MAKEFLAGS) arch-local || exit 1; \
$(MAKEPKG) --allsource --skipinteg --nodeps -p $$pkgbuild || exit 1;

arch-common: dist
pkgbuild=PKGBUILD-$(pkg); \
$(MAKE) $(AM_MAKEFLAGS) arch-local || exit 1; \
$(MAKEPKG) --skipinteg -p $$pkgbuild || exit 1;

distclean-local::
-$(RM) -R autom4te*.cache
-find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
Expand Down
21 changes: 21 additions & 0 deletions PKGBUILD-zfs-modules.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Maintainer: Prakash Surya <[email protected]>
pkgname=@ZFS_META_NAME@-modules
pkgver=@ZFS_META_VERSION@
pkgrel=@ZFS_META_RELEASE@
pkgdesc="Contains kernel modules and support utilities for the zfs file system."
arch=(x86_64)
url="git://github.com/zfsonlinux/zfs.git"
license=(@ZFS_META_LICENSE@)
depends=('spl-modules')
source=(@ZFS_META_NAME@-@[email protected])

build() {
cd $srcdir/@ZFS_META_NAME@-@ZFS_META_VERSION@
./configure --with-config=kernel
make
}

package() {
cd $srcdir/@ZFS_META_NAME@-@ZFS_META_VERSION@
make DESTDIR=$pkgdir install
}
28 changes: 28 additions & 0 deletions PKGBUILD-zfs.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Maintainer: Prakash Surya <[email protected]>
pkgname=@ZFS_META_NAME@
pkgver=@ZFS_META_VERSION@
pkgrel=@ZFS_META_RELEASE@
pkgdesc="Contains the libzfs library and support utilities for the zfs file system."
arch=(x86_64)
url="git://github.com/zfsonlinux/zfs.git"
license=(@ZFS_META_LICENSE@)
depends=('spl' 'zlib' 'e2fsprogs')
backup=('etc/zfs/zdev.conf')
source=(@ZFS_META_NAME@-@[email protected])

build() {
cd $srcdir/@ZFS_META_NAME@-@ZFS_META_VERSION@
./configure --with-config=user \
--prefix=/ \
--sysconfdir=/etc \
--libexecdir=/usr/libexec \
--datadir=/usr/share \
--includedir=/usr/include \
--with-udevdir=/lib/udev
make
}

package() {
cd $srcdir/@ZFS_META_NAME@-@ZFS_META_VERSION@
make DESTDIR=$pkgdir install
}
6 changes: 6 additions & 0 deletions cmd/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ GREP = @GREP@
HAVE_ALIEN = @HAVE_ALIEN@
HAVE_DPKG = @HAVE_DPKG@
HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
HAVE_MAKEPKG = @HAVE_MAKEPKG@
HAVE_PACMAN = @HAVE_PACMAN@
HAVE_RPM = @HAVE_RPM@
HAVE_RPMBUILD = @HAVE_RPMBUILD@
INSTALL = @INSTALL@
Expand All @@ -206,6 +208,8 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAKEPKG = @MAKEPKG@
MAKEPKG_VERSION = @MAKEPKG_VERSION@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
Expand All @@ -220,6 +224,8 @@ PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PACMAN = @PACMAN@
PACMAN_VERSION = @PACMAN_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
RPM = @RPM@
Expand Down
6 changes: 6 additions & 0 deletions cmd/mount_zfs/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ GREP = @GREP@
HAVE_ALIEN = @HAVE_ALIEN@
HAVE_DPKG = @HAVE_DPKG@
HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
HAVE_MAKEPKG = @HAVE_MAKEPKG@
HAVE_PACMAN = @HAVE_PACMAN@
HAVE_RPM = @HAVE_RPM@
HAVE_RPMBUILD = @HAVE_RPMBUILD@
INSTALL = @INSTALL@
Expand All @@ -207,6 +209,8 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAKEPKG = @MAKEPKG@
MAKEPKG_VERSION = @MAKEPKG_VERSION@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
Expand All @@ -221,6 +225,8 @@ PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PACMAN = @PACMAN@
PACMAN_VERSION = @PACMAN_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
RPM = @RPM@
Expand Down
6 changes: 6 additions & 0 deletions cmd/sas_switch_id/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ GREP = @GREP@
HAVE_ALIEN = @HAVE_ALIEN@
HAVE_DPKG = @HAVE_DPKG@
HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
HAVE_MAKEPKG = @HAVE_MAKEPKG@
HAVE_PACMAN = @HAVE_PACMAN@
HAVE_RPM = @HAVE_RPM@
HAVE_RPMBUILD = @HAVE_RPMBUILD@
INSTALL = @INSTALL@
Expand All @@ -191,6 +193,8 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAKEPKG = @MAKEPKG@
MAKEPKG_VERSION = @MAKEPKG_VERSION@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
Expand All @@ -205,6 +209,8 @@ PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PACMAN = @PACMAN@
PACMAN_VERSION = @PACMAN_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
RPM = @RPM@
Expand Down
6 changes: 6 additions & 0 deletions cmd/zdb/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ GREP = @GREP@
HAVE_ALIEN = @HAVE_ALIEN@
HAVE_DPKG = @HAVE_DPKG@
HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
HAVE_MAKEPKG = @HAVE_MAKEPKG@
HAVE_PACMAN = @HAVE_PACMAN@
HAVE_RPM = @HAVE_RPM@
HAVE_RPMBUILD = @HAVE_RPMBUILD@
INSTALL = @INSTALL@
Expand All @@ -208,6 +210,8 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAKEPKG = @MAKEPKG@
MAKEPKG_VERSION = @MAKEPKG_VERSION@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
Expand All @@ -222,6 +226,8 @@ PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PACMAN = @PACMAN@
PACMAN_VERSION = @PACMAN_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
RPM = @RPM@
Expand Down
6 changes: 6 additions & 0 deletions cmd/zfs/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ GREP = @GREP@
HAVE_ALIEN = @HAVE_ALIEN@
HAVE_DPKG = @HAVE_DPKG@
HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
HAVE_MAKEPKG = @HAVE_MAKEPKG@
HAVE_PACMAN = @HAVE_PACMAN@
HAVE_RPM = @HAVE_RPM@
HAVE_RPMBUILD = @HAVE_RPMBUILD@
INSTALL = @INSTALL@
Expand All @@ -208,6 +210,8 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAKEPKG = @MAKEPKG@
MAKEPKG_VERSION = @MAKEPKG_VERSION@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
Expand All @@ -222,6 +226,8 @@ PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PACMAN = @PACMAN@
PACMAN_VERSION = @PACMAN_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
RPM = @RPM@
Expand Down
6 changes: 6 additions & 0 deletions cmd/zinject/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ GREP = @GREP@
HAVE_ALIEN = @HAVE_ALIEN@
HAVE_DPKG = @HAVE_DPKG@
HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
HAVE_MAKEPKG = @HAVE_MAKEPKG@
HAVE_PACMAN = @HAVE_PACMAN@
HAVE_RPM = @HAVE_RPM@
HAVE_RPMBUILD = @HAVE_RPMBUILD@
INSTALL = @INSTALL@
Expand All @@ -208,6 +210,8 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAKEPKG = @MAKEPKG@
MAKEPKG_VERSION = @MAKEPKG_VERSION@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
Expand All @@ -222,6 +226,8 @@ PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PACMAN = @PACMAN@
PACMAN_VERSION = @PACMAN_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
RPM = @RPM@
Expand Down
6 changes: 6 additions & 0 deletions cmd/zpios/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ GREP = @GREP@
HAVE_ALIEN = @HAVE_ALIEN@
HAVE_DPKG = @HAVE_DPKG@
HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
HAVE_MAKEPKG = @HAVE_MAKEPKG@
HAVE_PACMAN = @HAVE_PACMAN@
HAVE_RPM = @HAVE_RPM@
HAVE_RPMBUILD = @HAVE_RPMBUILD@
INSTALL = @INSTALL@
Expand All @@ -198,6 +200,8 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAKEPKG = @MAKEPKG@
MAKEPKG_VERSION = @MAKEPKG_VERSION@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
Expand All @@ -212,6 +216,8 @@ PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PACMAN = @PACMAN@
PACMAN_VERSION = @PACMAN_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
RPM = @RPM@
Expand Down
Loading

0 comments on commit 6ba3b44

Please sign in to comment.