summaryrefslogtreecommitdiff
path: root/rpm
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2009-08-14 18:48:16 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2009-08-14 18:48:16 +0000
commit315d2a2dd3220e48ab836662c168a9cacc3d4585 (patch)
tree900e3dfd999a901e27e27a75c72ddac847574ae3 /rpm
parent17a3584e0f2f9fec5b76265d69b2c15e723e5447 (diff)
downloadMPC-315d2a2dd3220e48ab836662c168a9cacc3d4585.tar.gz
ChangeLogTag: Fri Aug 14 18:46:11 UTC 2009 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'rpm')
-rw-r--r--rpm/MPC.spec8
-rwxr-xr-xrpm/buildrpm.sh30
2 files changed, 30 insertions, 8 deletions
diff --git a/rpm/MPC.spec b/rpm/MPC.spec
index 45f78585..cbb6b3d3 100644
--- a/rpm/MPC.spec
+++ b/rpm/MPC.spec
@@ -8,7 +8,7 @@ BuildRoot: /tmp/mpc
Source: %{name}-%{version}.tar.bz2
URL: http://www.ociweb.com/products/mpc
Vendor: Object Computing, Inc.
-Packager: Chad Elliott <elliott_c@ociweb.com>
+Packager: PACKAGER
buildarch: noarch
%description
MPC (Make, Project and workspace Creator) is an open source tool, developed
@@ -22,9 +22,9 @@ specific project files from a common baseline.
%install
tar cf - * | (cd $RPM_BUILD_ROOT && tar xf -)
%post
-ln -sf /usr/lib/MPC/mwc.pl /usr/bin
-ln -sf /usr/lib/MPC/mpc.pl /usr/bin
+ln -sf FINALDIR/mwc.pl /usr/bin
+ln -sf FINALDIR/mpc.pl /usr/bin
%postun
rm -f /usr/bin/mwc.pl /usr/bin/mpc.pl
%files
-/usr/lib/MPC
+FINALDIR
diff --git a/rpm/buildrpm.sh b/rpm/buildrpm.sh
index c99c7d3b..98b224d8 100755
--- a/rpm/buildrpm.sh
+++ b/rpm/buildrpm.sh
@@ -30,6 +30,24 @@ while [ ! -x $loc/mpc.pl ]; do
loc=`dirname $loc`
done
+## Build up the packager name and email address
+if [ -z "REPLYTO" ]; then
+ DOMAIN=`hostname | sed 's/[^\.][^\.]*\.//'`
+ if [ -z "$DOMAIN" ]; then
+ DOMAIN=`grep '^search' /etc/resolv.conf | sed 's/.* //'`
+ fi
+ REPLYTO="$LOGNAME@$DOMAIN"
+fi
+PACKAGER=`grep $LOGNAME /etc/passwd | cut -d: -f5`
+if [ -z "$PACKAGER" ]; then
+ PACKAGER=$CL_USERNAME
+fi
+if [ -z "$PACKAGER" ]; then
+ PACKAGER="<$REPLYTO>"
+else
+ PACKAGER="$PACKAGER <$REPLYTO>"
+fi
+
## Save the MPC version
VERSION=`$loc/mpc.pl --version | sed 's/.*v//'`
@@ -42,7 +60,11 @@ MDIR=MPC-$VERSION
## This corresponds to BuildRoot in MPC.spec
BDIR=/tmp/mpc
-## The directory where RPM
+## This is the final install directory and corresponds to the %files section
+## of MPC.spec
+FDIR=/usr/lib/MPC
+
+## The directory where RPM will place the resulting file
if [ -x /usr/src/redhat ]; then
RPMLOC=/usr/src/redhat
else
@@ -52,12 +74,12 @@ fi
## Create our working directory and make the spec file
mkdir -p $WDIR
cd $WDIR
-sed "s/VERSION/$VERSION/" $loc/rpm/MPC.spec > MPC.spec
+sed "s/VERSION/$VERSION/; s/PACKAGER/$PACKAGER/; s!FINALDIR!$FDIR!" $loc/rpm/MPC.spec > MPC.spec
## Make a copy of the original MPC source to the new directory
-mkdir -p $MDIR/usr/lib/MPC
+mkdir -p $MDIR/$FDIR
cd $loc
-tar --exclude=.svn -cf - . | (cd $WDIR/$MDIR/usr/lib/MPC; tar -xf -)
+tar --exclude=.svn -cf - . | (cd $WDIR/$MDIR/$FDIR; tar -xf -)
## Create the build source tar.bz2
cd $WDIR