-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrpm.sh.in
More file actions
executable file
·21 lines (17 loc) · 797 Bytes
/
rpm.sh.in
File metadata and controls
executable file
·21 lines (17 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
PATH=/usr/bin
RPMDIR=$HOME/rpmbuild
mkdir -p $RPMDIR
cd $RPMDIR && mkdir -p SOURCES SPECS BUILD RPMS SRPMS && cd -
RPMFLAGS=--ba
SRCRPM=@PACKAGE_NAME@-@PACKAGE_VERSION@-@PACKAGE_RELEASE@.src.rpm
make dist-gzip
mv -u @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz $RPMDIR/SOURCES
cp -u src/rpm.spec $RPMDIR/SPECS/@PACKAGE_NAME@.spec
rpmbuild $RPMFLAGS $RPMDIR/SPECS/@PACKAGE_NAME@.spec
for package in `rpm -q --specfile src/rpm.spec`; do
arch=`echo $package | grep -E -o '[^.]+$$'`;
filename="$RPMDIR/RPMS/$arch/$package.rpm";
[ -e ../rpm/`basename $filename` ] || ln -v -s $filename ../rpm/`basename $filename`;
done
[ -e ../rpm/$SRCRPM ] || ln -v -s $RPMDIR/SRPMS/@PACKAGE_NAME@-@PACKAGE_VERSION@-@PACKAGE_RELEASE@`rpmbuild -E '%{?dist}' src/rpm.spec`.src.rpm ../rpm/$SRCRPM