summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2013-05-18 14:03:16 +0200
committerBrandon Philips <brandon@ifup.co>2013-05-18 21:42:24 -0700
commit8759e250048892c2eaef722976346e4c2ebc0e86 (patch)
treecd2de09f993077aafebfa4a99d3ab80481b11a57 /package
parented7473437c553a00b68e806da55fdc6364493263 (diff)
downloadattr-8759e250048892c2eaef722976346e4c2ebc0e86.tar.gz
Rename build/ to package/
Keep build/ directory for out-of-source builds.
Diffstat (limited to 'package')
-rw-r--r--package/Makefile63
-rw-r--r--package/rpm/Makefile76
-rw-r--r--package/rpm/attr.spec.in91
-rw-r--r--package/rpm/macros.template30
-rw-r--r--package/rpm/rpm-2.rc.template25
-rw-r--r--package/tar/Makefile36
6 files changed, 321 insertions, 0 deletions
diff --git a/package/Makefile b/package/Makefile
new file mode 100644
index 0000000..85dc1c5
--- /dev/null
+++ b/package/Makefile
@@ -0,0 +1,63 @@
+#
+# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
+# Copyright (C) 2009 Andreas Gruenbacher <agruen@suse.de>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+TOPDIR = ..
+include $(TOPDIR)/include/builddefs
+
+MANIFEST=src-manifest
+SRCTAR=$(PKG_NAME)-$(PKG_VERSION).src.tar.gz
+
+LDIRT = *-manifest *.gz $(TOPDIR)/$(PKG_NAME)-*
+
+# for clean and clobber
+SUBDIRS = tar rpm
+
+# nothing to build here (it's all packaging)
+default install install-dev install-lib:
+
+include $(BUILDRULES)
+
+# Symlink in the TOPDIR is used to pack files relative to
+# product-version directory.
+$(MANIFEST) : $(_FORCE)
+ @if [ ! -L $(TOPDIR)/$(PKG_NAME)-$(PKG_VERSION) ] ; then \
+ $(LN_S) . $(TOPDIR)/$(PKG_NAME)-$(PKG_VERSION) ; \
+ fi
+ @CDIR=`pwd`; cd $(TOPDIR); \
+ $(MAKE) --no-print-directory source | \
+ sed -e 's/^\./$(PKG_NAME)-$(PKG_VERSION)/' > $$CDIR/$@ ;\
+ if [ $$? -ne 0 ] ; then \
+ exit 1; \
+ else \
+ unset TAPE; \
+ $(TAR) -T $$CDIR/$@ -cf - | $(ZIP) --best > $$CDIR/$(SRCTAR); \
+ echo Wrote: $$CDIR/$(SRCTAR); \
+ fi
+
+dist : default $(MANIFEST)
+ @DIST_MANIFEST=`pwd`/bin-manifest; DIST_ROOT=/tmp/$$$$; \
+ export DIST_MANIFEST DIST_ROOT; \
+ rm -f $$DIST_MANIFEST; \
+ echo === install === && $(MAKE) -C $(TOPDIR) install || exit $$?; \
+ if [ -x $(TAR) ]; then \
+ ( echo "=== tar ===" && $(MAKEF) -C tar $@ || exit $$? ); \
+ fi; \
+ if [ -x $(RPMBUILD) ]; then \
+ ( echo "=== rpm ===" && $(MAKEF) -C rpm $@ || exit $$? ); \
+ fi; \
+ test -z "$$KEEP_DIST_ROOT" || rm -rf $$DIST_ROOT; echo Done
diff --git a/package/rpm/Makefile b/package/rpm/Makefile
new file mode 100644
index 0000000..173c367
--- /dev/null
+++ b/package/rpm/Makefile
@@ -0,0 +1,76 @@
+#
+# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
+# Copyright (C) 2009 Andreas Gruenbacher <agruen@suse.de>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+TOPDIR = ../..
+TREEROOT = $(shell cd ${TOPDIR}; pwd)
+include $(TOPDIR)/include/builddefs
+
+SPECF = $(PKG_NAME).spec
+LDIRT = *.rpm $(SPECF) rpmmacros rpmfiles* rpm-*.rc
+
+LSRCFILES = macros.template $(SPECF).in rpm-2.rc.template
+
+default install install-dev install-lib:
+
+include $(BUILDRULES)
+
+# Generate a binary rpm file
+dist : default $(SPECF) rpm-$(RPM_VERSION).rc
+ $(RPMBUILD) -ba --rcfile ./rpm-$(RPM_VERSION).rc $(SPECF)
+
+# Because rpm prior to v.2.90 does not support macros and old style config
+# is not supported by rpm v.3, we have to resort to such ugly hacks
+ifneq ($(RPM_VERSION),2)
+rpm-$(RPM_VERSION).rc : rpmmacros
+ @$(SED) -e '/^macrofiles:/s|~/.rpmmacros|rpmmacros|' </usr/lib/rpm/rpmrc >$@
+
+rpmmacros : macros.template
+ @$(SED) -e 's|%topdir%|$(TREEROOT)|g' < $< > $@
+else
+rpm-2.rc: rpm-2.rc.template
+ @$(SED) -e 's|%topdir%|$(TOPDIR)|g' < $< > $@
+endif
+
+# Generate the rpm specfile format file list from the install-sh manifest
+rpmfiles rpmfiles-dev rpmfiles-lib:
+ $(SORT) -u $$DIST_MANIFEST | $(AWK) > $@ '\
+$$1 == "d" { printf ("%%%%dir %%%%attr(%s,%s,%s) %s\n", $$2, $$3, $$4, $$5); } \
+$$1 == "f" { if (match ($$6, "$(PKG_MAN_DIR)") || \
+ match ($$6, "$(PKG_DOC_DIR)")) \
+ printf ("%%%%doc "); \
+ if (match ($$6, "$(PKG_MAN_DIR)")) \
+ printf ("%%%%attr(%s,%s,%s) %s*\n", $$2, $$3, $$4, $$6); \
+ else \
+ printf ("%%%%attr(%s,%s,%s) %s\n", $$2, $$3, $$4, $$6); } \
+$$1 == "l" { if (match ($$3, "$(PKG_MAN_DIR)") || \
+ match ($$3, "$(PKG_DOC_DIR)")) \
+ printf ("%%%%doc "); \
+ if (match ($$3, "$(PKG_MAN_DIR)")) \
+ printf ("%%%%attr(0777,root,root) %s*\n", $$3); \
+ else \
+ printf ("%%%%attr(0777,root,root) %s\n", $$3); }'
+
+.PHONY: $(SPECF)
+${SPECF} : ${SPECF}.in
+ $(SED) -e's|@pkg_name@|$(PKG_NAME)|g' \
+ -e's|@pkg_version@|$(PKG_VERSION)|g' \
+ -e's|@pkg_release@|$(PKG_RELEASE)|g' \
+ -e's|@pkg_distribution@|$(PKG_DISTRIBUTION)|g' \
+ -e's|@build_root@|$(DIST_ROOT)|g' \
+ -e'/^BuildRoot: *$$/d' \
+ -e's|@make@|$(MAKE)|g' < $< > $@
diff --git a/package/rpm/attr.spec.in b/package/rpm/attr.spec.in
new file mode 100644
index 0000000..493b881
--- /dev/null
+++ b/package/rpm/attr.spec.in
@@ -0,0 +1,91 @@
+Summary: Utilities for managing filesystem extended attributes.
+Name: @pkg_name@
+Version: @pkg_version@
+Release: @pkg_release@
+Packager: Silicon Graphics, Inc. <http://www.sgi.com/>
+BuildRoot: @build_root@
+Prereq: /sbin/ldconfig
+Conflicts: xfsdump < 2.0.0
+Source: @pkg_name@-@pkg_version@.src.tar.gz
+License: GPL
+Vendor: Silicon Graphics, Inc.
+URL: http://oss.sgi.com/projects/xfs/
+Group: System Environment/Base
+
+%description
+A set of tools for manipulating extended attributes on filesystem
+objects, in particular getfattr(1) and setfattr(1).
+An attr(1) command is also provided which is largely compatible
+with the SGI IRIX tool of the same name.
+
+%package -n libattr
+Summary: Dynamic library for extended attribute support.
+Group: Development/Libraries
+Prereq: /sbin/ldconfig
+
+%description -n libattr
+This package contains the libattr.so dynamic library which contains
+the extended attribute system calls and library functions.
+
+%package -n libattr-devel
+Summary: Extended attribute static libraries and headers.
+Group: Development/Libraries
+Requires: libattr
+Obsoletes: attr-devel
+
+%description -n libattr-devel
+This package contains the libraries and header files needed to
+develop programs which make use of extended attributes.
+For Linux programs, the documented system call API is the
+recommended interface, but an SGI IRIX compatibility interface
+is also provided.
+
+Currently only ext2, ext3, JFS and XFS support extended attributes.
+The SGI IRIX compatibility API built above the Linux system calls is
+used by programs such as xfsdump(8), xfsrestore(8) and xfs_fsr(8).
+
+You should install libattr-devel if you want to develop programs
+which make use of extended attributes. If you install libattr-devel
+then you'll also want to install attr.
+
+%prep
+if [ -f .census ] ; then
+ if [ ! -d ${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION} ] ; then
+ ln -s . ${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION}
+ fi
+else
+%setup
+INSTALL_USER=root
+INSTALL_GROUP=root
+export INSTALL_USER INSTALL_GROUP
+@make@ configure
+fi
+
+%build
+@make@
+
+%install
+DIST_ROOT="$RPM_BUILD_ROOT"
+DIST_INSTALL=`pwd`/install.manifest
+DIST_INSTALL_DEV=`pwd`/install-dev.manifest
+DIST_INSTALL_LIB=`pwd`/install-lib.manifest
+export DIST_ROOT DIST_INSTALL DIST_INSTALL_DEV DIST_INSTALL_LIB
+@make@ install DIST_MANIFEST="$DIST_INSTALL"
+@make@ -C build/rpm rpmfiles DIST_MANIFEST="$DIST_INSTALL"
+@make@ install-dev DIST_MANIFEST="$DIST_INSTALL_DEV"
+@make@ -C build/rpm rpmfiles-dev DIST_MANIFEST="$DIST_INSTALL_DEV"
+@make@ install-lib DIST_MANIFEST="$DIST_INSTALL_LIB"
+@make@ -C build/rpm rpmfiles-lib DIST_MANIFEST="$DIST_INSTALL_LIB"
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -n libattr -p /sbin/ldconfig
+
+%postun -n libattr -p /sbin/ldconfig
+
+%files -f build/rpm/rpmfiles
+
+%files -n libattr-devel -f build/rpm/rpmfiles-dev
+
+%files -n libattr -f build/rpm/rpmfiles-lib
diff --git a/package/rpm/macros.template b/package/rpm/macros.template
new file mode 100644
index 0000000..6ab46e1
--- /dev/null
+++ b/package/rpm/macros.template
@@ -0,0 +1,30 @@
+#
+# rpmrc.template
+#
+# Template to fudge rpm directory structure inside IRIX-like build
+# environment
+
+# Force 386 build on all platforms
+%_target i386-pc-linux
+%_target_cpu i386
+%_target_os linux
+
+# topdir == $(WORKAREA)
+%_topdir %topdir%
+
+# Following directories are specific to the topdir
+# This is where build is done. In our case it's the same as $WORKAREA
+%_builddir %topdir%
+
+# This is where foo.1.99.tar.gz is living in the real world.
+# Be careful not to run full rpm build as it will override the sources
+%_sourcedir %topdir%/build
+
+# This is where binary RPM and source RPM would end up
+%_rpmdir %topdir%/build/rpm
+%_srcrpmdir %topdir%/build/rpm
+%_specdir %topdir%/build/rpm
+
+# Leave RPM files in the same directory - we're not building for
+# multiple architectures
+%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
diff --git a/package/rpm/rpm-2.rc.template b/package/rpm/rpm-2.rc.template
new file mode 100644
index 0000000..f3b3eba
--- /dev/null
+++ b/package/rpm/rpm-2.rc.template
@@ -0,0 +1,25 @@
+#
+# rpmrc.template
+#
+# Template to fudge rpm directory structure inside IRIX-like build
+# environment
+
+# topdir == $(WORKAREA)
+topdir: %topdir%
+
+# Following directories are specific to the topdir
+# This is where build is done. In out case it's the same as $WORKAREA
+# Be careful not to run full rpm build as it will override the sources
+builddir: %topdir%
+
+# This is where foo.1.99.tar.gz is living in the real world.
+sourcedir: %topdir%/build
+
+# This is where binary RPM and source RPM would end up
+rpmdir: %topdir%/build/rpm
+srcrpmdir: %topdir%/build/rpm
+specdir: %topdir%/build/rpm
+
+# Leave RPM files in the same directory - we're not building for
+# multiple architectures
+rpmfilename: %{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm
diff --git a/package/tar/Makefile b/package/tar/Makefile
new file mode 100644
index 0000000..c27999d
--- /dev/null
+++ b/package/tar/Makefile
@@ -0,0 +1,36 @@
+#
+# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
+# Copyright (C) 2009 Andreas Gruenbacher <agruen@suse.de>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+TOPDIR = ../..
+include $(TOPDIR)/include/builddefs
+
+BINTAR=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+LDIRT = *.gz
+
+default install install-dev install-lib:
+
+include $(BUILDRULES)
+
+dist : default
+ @HERE=`pwd`; cd $${DIST_ROOT:-/}; \
+ $(SORT) -u $$HERE/../bin-manifest | $(AWK) ' \
+ $$1 == "f" { printf (".%s\n", $$6); } \
+ $$1 == "d" { next; } \
+ $$1 == "l" { printf (".%s\n", $$3); }' \
+ | $(TAR) -T - -cf - | $(ZIP) --best > $$HERE/$(BINTAR)
+ @echo Wrote: `pwd`/$(BINTAR)