if $verbose ; then
dpkg-buildpackage -r$SUDO | tee $LOGDEB
else
- dpkg-buildpackage -r$SUDO > $LOGDEB
+ dpkg-buildpackage -r$SUDO > $LOGDEB || exit 1
fi
exit 0
fi
if $verbose ; then
$MAKE clean 2>&1 | tee $LOGDIR/clean
else
- $MAKE clean > $LOGDIR/clean 2>&1
-fi
-if [ $? -ne 0 ] ; then
- echo \"$MAKE clean\" failed, see log in $LOGDIR/clean
- tail $LOGDIR/clean
- exit 1
+ $MAKE clean > $LOGDIR/clean 2>&1 || exit 1
fi
echo
if $verbose ; then
$MAKE configure 2>&1 | tee $LOGDIR/configure
else
- $MAKE configure > $LOGDIR/configure 2>&1
-fi
-if [ $? -ne 0 ] ; then
- echo \"configure\" failed, see log in $LOGDIR/configure
- tail $LOGDIR/configure
- exit 1
+ $MAKE configure > $LOGDIR/configure 2>&1 || exit 1
fi
echo
if $verbose ; then
$MAKE default 2>&1 | tee $LOGDIR/default
else
- $MAKE default > $LOGDIR/default 2>&1
-fi
-if [ $? -ne 0 ] ; then
- echo \"$MAKE default\" failed, see log in $LOGDIR/default
- tail $LOGDIR/default
- exit 1
+ $MAKE default > $LOGDIR/default 2>&1 || exit 1
fi
echo
if $verbose ; then
$MAKE -C build dist 2>&1 | tee $LOGDIR/dist
else
- $MAKE -C build dist > $LOGDIR/dist 2>&1
-fi
-if [ $? -ne 0 ] ; then
- echo $MAKE dist failed, see log in $LOGDIR/dist
- tail $LOGDIR/dist
- exit 1
-else
+ $MAKE -C build dist > $LOGDIR/dist 2>&1 || exit 1
grep '^Wrote:' $LOGDIR/dist | sed -e 's/\.\.\/\.\.\///'
fi
#
-# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
+# Copyright (c) 2000-2003 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
include $(TOPDIR)/include/builddefs
SPECF = $(PKG_NAME).spec
-LDIRT = $(PKG_NAME)*.rpm $(SPECF) rpmmacros rpm-*.rc $(TOPDIR)/files*.rpm
+LDIRT = *.rpm $(SPECF) rpmmacros rpmfiles* rpm-*.rc
LSRCFILES = macros.template $(SPECF).in rpm-2.rc.template
-default install install-dev :
+default install install-dev install-lib:
include $(BUILDRULES)
-# generate a binary rpm file
+# Generate a binary rpm file
dist : default $(SPECF) rpm-$(RPM_VERSION).rc
$(RPMBUILD) -ba --rcfile ./rpm-$(RPM_VERSION).rc $(SPECF)
@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' \
Name: @pkg_name@
Version: @pkg_version@
Release: @pkg_release@
+Distribution: @pkg_distribution@
Packager: Silicon Graphics, Inc. <http://www.sgi.com/>
BuildRoot: @build_root@
Provides: xfs-cmds
DIST_INSTALL_DEV=`pwd`/install-dev.manifest
export DIST_ROOT DIST_INSTALL DIST_INSTALL_DEV
@make@ install DIST_MANIFEST="$DIST_INSTALL"
+@make@ -C build/rpm rpmfiles 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 ");
- 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); }'
-}
-set +x
-files < "$DIST_INSTALL" > files.rpm
-files < "$DIST_INSTALL_DEV" > filesdevel.rpm
-set -x
+@make@ -C build/rpm rpmfiles-dev DIST_MANIFEST="$DIST_INSTALL_DEV"
%clean
rm -rf $RPM_BUILD_ROOT
%postun -p /sbin/ldconfig
-%files -f files.rpm
+%files -f build/rpm/rpmfiles
-%files devel -f filesdevel.rpm
+%files devel -f build/rpm/rpmfiles-dev