diff options
author | Nathan Scott <nathans@sgi.com> | 2001-01-15 03:18:30 +0000 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2001-01-15 03:18:30 +0000 |
commit | 02f43564629f54847c04cc32f77cb1b6ba3b89c2 (patch) | |
tree | ae1217c94a5d2659dcf985e1385941e20ef2f60f /build | |
parent | 82129da6af3a2cddad3334623cfe415058036e4c (diff) | |
download | attr-02f43564629f54847c04cc32f77cb1b6ba3b89c2.tar.gz |
initial version for reworked extended attributes build environment.
Diffstat (limited to 'build')
-rw-r--r-- | build/Makefile | 76 | ||||
-rw-r--r-- | build/rpm/Makefile | 76 | ||||
-rw-r--r-- | build/rpm/attr.spec.in | 81 | ||||
-rw-r--r-- | build/rpm/macros.template | 30 | ||||
-rw-r--r-- | build/rpm/rpm-2.rc.template | 25 | ||||
-rw-r--r-- | build/tar/Makefile | 50 |
6 files changed, 338 insertions, 0 deletions
diff --git a/build/Makefile b/build/Makefile new file mode 100644 index 0000000..0411a6d --- /dev/null +++ b/build/Makefile @@ -0,0 +1,76 @@ +# +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +# + +TOPDIR = .. +include $(TOPDIR)/include/builddefs + +MANIFEST=src-manifest +SRCTAR=$(PKG_NAME)-$(PKG_VERSION).src.tar.gz + +LDIRT = $(MANIFEST) $(SRCTAR) bin-manifest $(TOPDIR)/$(PKG_NAME)-$(PKG_VERSION) + +# for clean and clobber +SUBDIRS = tar rpm + +# nothing to build here (it's all packaging) +default install install-dev : + +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); \ + 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 $(RPM) ]; then \ + ( echo "=== rpm ===" && $(MAKEF) -C rpm $@ || exit $$? ); \ + fi; \ + test -z "$$KEEP_DIST_ROOT" || rm -rf $$DIST_ROOT; echo Done diff --git a/build/rpm/Makefile b/build/rpm/Makefile new file mode 100644 index 0000000..bd7eefe --- /dev/null +++ b/build/rpm/Makefile @@ -0,0 +1,76 @@ +# +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +# + +TOPDIR = ../.. +TREEROOT = $(shell cd ${TOPDIR}; pwd) +include $(TOPDIR)/include/builddefs + +SPECF = $(PKG_NAME).spec +LDIRT = $(PKG_NAME)*.rpm $(SPECF) rpmmacros rpm-*.rc $(TOPDIR)/files*.rpm + +LSRCFILES = macros.template $(SPECF).in rpm-2.rc.template + +default install install-dev : + +include $(BUILDRULES) + +# generate a binary rpm file +dist : default $(SPECF) rpm-$(RPM_VERSION).rc + $(RPM) -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 + +.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|@pkg_builder@|$(PKG_BUILDER)|g' \ + -e's|@build_root@|$(DIST_ROOT)|g' \ + -e'/^BuildRoot: *$$/d' \ + -e's|@pkg_var_dir@|$(PKG_VAR_DIR)|g' \ + -e's|@pkg_share_dir@|$(PKG_SHARE_DIR)|g' \ + -e's|@pkg_log_dir@|$(PKG_LOG_DIR)|g' \ + -e's|@pkg_tmp_dir@|$(PKG_TMP_DIR)|g' \ + -e's|@make@|$(MAKE)|g' < $< > $@ diff --git a/build/rpm/attr.spec.in b/build/rpm/attr.spec.in new file mode 100644 index 0000000..a51c7d1 --- /dev/null +++ b/build/rpm/attr.spec.in @@ -0,0 +1,81 @@ +Summary: Utility for managing filesystem extended attributes. +Name: @pkg_name@ +Version: @pkg_version@ +Release: @pkg_release@ +Distribution: @pkg_distribution@ +Packager: @pkg_builder@ +BuildRoot: @build_root@ +Prereq: /sbin/ldconfig +Source: @pkg_name@-@pkg_version@.src.tar.gz +Copyright: Copyright (C) 2000 Silicon Graphics, Inc. +Vendor: Silicon Graphics, Inc. +URL: http://oss.sgi.com/projects/xfs/ +Group: System Environment/Base + +%description +An *experimental* command (attr) to manipulate extended attributes +under Linux. + +%package devel +Summary: Extended attribute static libraries and headers. +Group: Development/Libraries +Requires: @pkg_name@ + +%description devel +attr-devel contains the libraries and header files needed to +develop programs which make use of extended attributes. +This is an *experimental* interface, currently only XFS is +supported, and the interface may change. + +You should install attr-devel if you want to develop programs +which make use of extended attributes. If you install attr-devel, +you'll also want to install attr. + +# If .census exists, then no setup is necessary, just go and do the build, +# otherwise run setup +%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 +touch .census +./configure +fi + +%build +@make@ + +%install +DIST_ROOT="$RPM_BUILD_ROOT" +DIST_INSTALL=`pwd`/install.manifest +DIST_INSTALL_DEV=`pwd`/install-dev.manifest +export DIST_ROOT DIST_INSTALL DIST_INSTALL_DEV +@make@ install DIST_MANIFEST="$DIST_INSTALL" +@make@ install-dev DIST_MANIFEST="$DIST_INSTALL_DEV" +files() +{ + sort | uniq | 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 "); + } + printf ("%%%%attr(%s,%s,%s) %s\n", $2, $3, $4, $6); } +$1 == "l" { print "%attr(0777,root,root)", $3; }' +} +set +x +files < "$DIST_INSTALL" > files.rpm +files < "$DIST_INSTALL_DEV" > filesdevel.rpm +set -x + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files -f files.rpm + +%files devel -f filesdevel.rpm diff --git a/build/rpm/macros.template b/build/rpm/macros.template new file mode 100644 index 0000000..6ab46e1 --- /dev/null +++ b/build/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/build/rpm/rpm-2.rc.template b/build/rpm/rpm-2.rc.template new file mode 100644 index 0000000..f3b3eba --- /dev/null +++ b/build/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/build/tar/Makefile b/build/tar/Makefile new file mode 100644 index 0000000..63540f9 --- /dev/null +++ b/build/tar/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +# + +TOPDIR = ../.. +include $(TOPDIR)/include/builddefs + +BINTAR=$(PKG_NAME)-$(PKG_VERSION).tar.gz +LDIRT = $(BINTAR) + +default install install-dev : + +include $(BUILDRULES) + +dist : default + @HERE=`pwd`; cd $${DIST_ROOT:-/}; \ + sort $$HERE/../bin-manifest | uniq | $(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) |