one step rpm build from cvs
Brian Craft
bcboy at thecraftstudio.com
Thu Aug 21 10:41:19 EDT 2003
In case someone finds it useful, I'm attaching a script which will build an
rpm from the latest cvs snapshot tarball. I wrote it before I discovered that
alpha downloads were on the "News" page, not the "Downloads" page.
The script grabs the latest tarball and recent automake and gettext (which
are needed on RH9), and builds an rpm with version == snapshot date.
b.c.
-------------- next part --------------
GETTEXTV=0.12.1
AUTOMAKEV=1.7.6
TMP=/tmp
mkdir -p $TMP/openbox-autobuild
cd $TMP/openbox-autobuild
mkdir -p rpm/SPECS
mkdir -p rpm/BUILD
mkdir -p rpm/SRPMS
mkdir -p rpm/SOURCES
mkdir -p rpm/RPMS/i386
function getsource () {
FILE=`basename $1`
tar ztf $FILE > /dev/null 2>&1 ||
wget --passive-ftp $1
tar ztf $FILE > /dev/null 2>&1 || {
echo "Couldn't get $1"; exit 1;
}
}
cd rpm/SOURCES
getsource ftp://ftp.gnu.org/gnu/automake/automake-$AUTOMAKEV.tar.gz;
getsource ftp://ftp.gnu.org/gnu/gettext/gettext-$GETTEXTV.tar.gz;
getsource http://icculus.org/openbox/openbox-current.tar.gz;
VERSION=`tar ztf openbox-current.tar.gz | head -n 1 | cut -c 9-18`
RELEASE=`echo $VERSION | sed -e 's/-//g'`
cd ..
cat > SPECS/openbox.spec <<EOF
%define _topdir $TMP/openbox-autobuild/rpm
Summary: Openbox is a standards compliant, fast, light-weight, extensible window manager.
Name: openbox
%define version 0.3.0
Version: %{version}
Release: $RELEASE
Copyright: GPL
Group: X11/Window Managers
Source0: %{name}-current.tar.gz
Source1: automake-$AUTOMAKEV.tar.gz
Source2: gettext-$GETTEXTV.tar.gz
Buildroot: /tmp/%{name}-root
%description
Openbox works with your applications, and makes your desktop easier to manage.
This is because the approach to its development was the opposite of what seems
to be the general case for window managers. Openbox was written first to comply
with standards and to work properly. Only when that was in place did the team
turn to the visual interface.
%prep
printenv
tar zxf \$RPM_SOURCE_DIR/openbox-current.tar.gz
tar zxf \$RPM_SOURCE_DIR/gettext-$GETTEXTV.tar.gz
tar zxf \$RPM_SOURCE_DIR/automake-$AUTOMAKEV.tar.gz
%build
cd automake-$AUTOMAKEV
./configure --prefix=$TMP/openbox-autobuild
make install
PATH=$TMP/openbox-autobuild/bin:\$PATH
cd \$RPM_BUILD_DIR/gettext-$GETTEXTV
./configure --prefix=$TMP/openbox-autobuild
make install
cd \$RPM_BUILD_DIR/openbox-$VERSION
# set ACLOCAL_FLAGS to fall-back to the system aclocal, so we get
# pkg.m4
ACLOCAL_FLAGS='-I /usr/share/aclocal' ./bootstrap
%configure --disable-nls
make
%install
rm -rf \$RPM_BUILD_ROOT
cd \$RPM_BUILD_DIR/openbox-$VERSION
DESTDIR=\$RPM_BUILD_ROOT make -e install
%clean
rm -rf \$RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc openbox-$VERSION/AUTHORS openbox-$VERSION/README openbox-$VERSION/COPYING openbox-$VERSION/TODO openbox-$VERSION/ChangeLog
/usr/bin
/usr/share
/usr/lib
EOF
cd SPECS
rpmbuild -ba openbox.spec
More information about the openbox
mailing list