Already a member?
Sign in
| Version | User | Scope of changes |
|---|---|---|
| Feb 19 2007, 4:51 AM EST (current) | waveclaw | 343 words added |
| Feb 19 2007, 4:28 AM EST | waveclaw | 33 words added, 9 words deleted |
Changes
Key: Additions Deletions
Description
This is a .SPEC file based on the SVN version of AWN. This file can be used to make an RPM for SuSE 10.1 and 10.2 Linux. This lets me checkout the SVN code, build an RPM and SRPM from it and install AWN as if it were any other packaged software. Avant-Window-navigator.spec
# awn rpm specfile for openSuSE 10.2, (c) 2006# waveclaw@waveclaw.net
#
#This program is distributed under the terms of the GPL v2 or later.
# GNU GENERAL PUBLIC LICENSE
# Version 2, June 1991
# made with KRPMBuilder which is (c) 2002, Olaf Lueg; (c) 2005, Wolfgang Beutner
#
Name: avant-window-navigator
Version: 0.1.1
Summary: Avant Window Navigator is a fully customisable dock-like window navigator for GNOME.
Release: 3
License: GPL
Group: User Interface/Desktops
Source: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/build-root-%{name}
Packager: Waveclaw.net Packager Team
Distribution: openSuSE
Prefix: /opt/gnome
Url: http://code.google.com/p/avant-window-navigator/
Provides: avant-window-navigator
%description
Avant Window Navigator is a fully customizable dock-like window navigator for GNOME.
%prep
rm -rf $RPM_BUILD_ROOT
mkdir $RPM_BUILD_ROOT
%setup -q
%build
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \
./autogen.sh --prefix=%{prefix}
# Autogen spawns configure as it's last act
#./configure --prefix=%{prefix}
make -j 2
%install
make DESTDIR=$RPM_BUILD_ROOT install-strip
#Pre 0.1.1 needed to manually fix schemas, SuSE
# puts them in a different location than Red Hat
#gconftool-2 --install-schema-file=$RPM_BUILD_ROOT/etc/gconf/schemas/avant-window-navigator.schemas
# Likewise, GNOME in SuSE Prior to 10.3 lives in /opt
# these dirs are hardcoded into AWN causing the prefs
# utility to die.
mkdir -p $RPM_BUILD_ROOT/usr/share/avant-window-navigator/active
mkdir -p $RPM_BUILD_ROOT/usr/share/nautilus/patterns
cd $RPM_BUILD_ROOT
find . -type d -fprint $RPM_BUILD_DIR/file.list.%{name}.dirs
find . -type f -fprint $RPM_BUILD_DIR/file.list.%{name}.files.tmp
sed '/\/man\//s/$/.gz/g' $RPM_BUILD_DIR/file.list.%{name}.files.tmp > $RPM_BUILD_DIR/file.list.%{name}.files
find . -type l -fprint $RPM_BUILD_DIR/file.list.%{name}.libs
sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' $RPM_BUILD_DIR/file.list.%{name}.dirs > $RPM_BUILD_DIR/file.list.%{name}
sed 's,^\.,\%attr(-\,root\,root) ,' $RPM_BUILD_DIR/file.list.%{name}.files >> $RPM_BUILD_DIR/file.list.%{name}
sed 's,^\.,\%attr(-\,root\,root) ,' $RPM_BUILD_DIR/file.list.%{name}.libs >> $RPM_BUILD_DIR/file.list.%{name}
%clean
rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_DIR/file.list.%{name}
rm -rf $RPM_BUILD_DIR/file.list.%{name}.libs
rm -rf $RPM_BUILD_DIR/file.list.%{name}.files
rm -rf $RPM_BUILD_DIR/file.list.%{name}.files.tmp
rm -rf $RPM_BUILD_DIR/file.list.%{name}.dirs
# this file.list (and the above find's to make it) is the reason KRPMBuilder is used.
%files -f ../file.list.%{name}
%defattr(-,root,root,0755)
Usage
This .SPEC file is used with a tar'd copy of AWN and rpmbuild to create an rpm package file.A .SPEC file is used by the rpm tool to describe a package. It contains meta-information and the outline of the traditional ./configure, make, sudo make install process from C code distributed in tarballs. The rpm tool has historically been broken out into rpm, the package manager, and rpmbuild, the package maker.
There are three typical ways to use this file/ These are generic to rpm's built on Mandrake, SuSE, RedHat and other rpm-based distributions of Linux.
- "Inline"
- Copy the content above into a file with the extention spec. Customize the Version, Release and Packager.
- Checkout a copy of AWN from SVN.
- Rename the top-level directory of AWN to match settings in the Version field you set in the .SPEC file.
- Put the file you made into this directory and tar it back up.
- Run rpmbuild -ta $TARBALL_NAME to have the rpm automatically built from the tarball.
- "Release Style"
- Copy the content into a file called avant-window-manager-$VER.spec for the version $VER you are releasing.
- Put this specfile into /usr/src/packages/SPECS
- Create tarball of an AWN checkout as above. Place the tarball into /usr/src/packages/SOURCES
- Publish your srpm and rpm. The srpm automates steps 1-3 of this process when installed
- "RPMmacro Style"
- "Release Style" requires you to do a lot of work as root. Replicate the /usr/src/packages tree in a convenient directory (say ~/packages)
- rpm and rpmbuild use the ~/.rpmmacros file for per-user configuration. Add lines pointing rpm and rpmbuild to your new directory
- %_topdir ~/packages
- %_tmppath ~/packages
- Follow the "Release Style" usage, but now you don't need to be root since you are using your new local ~/packages directory instead of the system-wide /usr/src/packages.
- Once you set a ~/.rpmmacros file, any future execution of rpm -i on a source package will put the tarball into ~/packages/SOURCES and the specfile into ~/packages/SPECS. If you aquire AWN in an srpms, you can use the RPMmacro Style to build AWN without risking any 'helpful additions' affecting your system.
Notes
- A couple of workarounds are in place to deal with Red Hat-isms in the AWN code. These may need fiddling to work or AWN development could outdate them fast.
- If I had the time I could write patches against the SVN and use RPM's build-in patch feature to apply them when building the SRPM.
- I include AWN in Waveclaw.net's non-public SuSE YaST repository. My repository is non public because most the code is either old or broken and really only meant for building internal desktops. This .SPEC file should be able, with customization and clean-up, to produce rpm's suitable for inclusion in a public repository.
