Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add make rule for building Arch Linux packages #491

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
24 changes: 24 additions & 0 deletions PKGBUILD-zfs-modules.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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 \
--prefix=/usr \
--sysconfdir=/etc \
--libexecdir=/usr/lib
make
}

package() {
cd $srcdir/@ZFS_META_NAME@-@ZFS_META_VERSION@
make DESTDIR=$pkgdir install
}
25 changes: 25 additions & 0 deletions PKGBUILD-zfs.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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=/usr \
--sysconfdir=/etc \
--libexecdir=/usr/lib
make
}

package() {
cd $srcdir/@ZFS_META_NAME@-@ZFS_META_VERSION@
make DESTDIR=$pkgdir install
}
40 changes: 40 additions & 0 deletions config/arch.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
###############################################################################
# Written by Prakash Surya <[email protected]>
###############################################################################
# Build targets for RPM packages.
###############################################################################

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;
44 changes: 44 additions & 0 deletions config/zfs-build.m4
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,48 @@ AC_DEFUN([ZFS_AC_ALIEN], [
AC_SUBST(ALIEN_VERSION)
])

dnl #
dnl # Check for pacman+makepkg to build Arch Linux packages. If these
dnl # tools are missing it is non-fatal but you will not be able to
dnl # build Arch Linux packages and will be warned if you try too.
dnl #
AC_DEFUN([ZFS_AC_PACMAN], [
PACMAN=pacman
MAKEPKG=makepkg

AC_MSG_CHECKING([whether $PACMAN is available])
tmp=$($PACMAN --version 2>/dev/null)
AS_IF([test -n "$tmp"], [
PACMAN_VERSION=$(echo $tmp |
$AWK '/Pacman/ { print $[3] }' |
$SED 's/^v//')
HAVE_PACMAN=yes
AC_MSG_RESULT([$HAVE_PACMAN ($PACMAN_VERSION)])
],[
HAVE_PACMAN=no
AC_MSG_RESULT([$HAVE_PACMAN])
])

AC_MSG_CHECKING([whether $MAKEPKG is available])
tmp=$($MAKEPKG --version 2>/dev/null)
AS_IF([test -n "$tmp"], [
MAKEPKG_VERSION=$(echo $tmp | $AWK '/makepkg/ { print $[3] }')
HAVE_MAKEPKG=yes
AC_MSG_RESULT([$HAVE_MAKEPKG ($MAKEPKG_VERSION)])
],[
HAVE_MAKEPKG=no
AC_MSG_RESULT([$HAVE_MAKEPKG])
])

AC_SUBST(HAVE_PACMAN)
AC_SUBST(PACMAN)
AC_SUBST(PACMAN_VERSION)

AC_SUBST(HAVE_MAKEPKG)
AC_SUBST(MAKEPKG)
AC_SUBST(MAKEPKG_VERSION)
])

dnl #
dnl # Using the VENDOR tag from config.guess set the default
dnl # package type for 'make pkg': (rpm | deb | tgz)
Expand Down Expand Up @@ -214,6 +256,7 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
slackware) DEFAULT_PACKAGE=tgz ;;
gentoo) DEFAULT_PACKAGE=tgz ;;
lunar) DEFAULT_PACKAGE=tgz ;;
arch) DEFAULT_PACKAGE=arch;;
*) DEFAULT_PACKAGE=rpm ;;
esac

Expand Down Expand Up @@ -254,5 +297,6 @@ AC_DEFUN([ZFS_AC_PACKAGE], [
ZFS_AC_RPM
ZFS_AC_DPKG
ZFS_AC_ALIEN
ZFS_AC_PACMAN
ZFS_AC_DEFAULT_PACKAGE
])
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ AC_CONFIG_FILES([
scripts/common.sh
zfs.spec
zfs-modules.spec
PKGBUILD-zfs
PKGBUILD-zfs-modules
zfs-script-config.sh
])

Expand Down