[lug] New to the scene of RPM building.
Scott Herod
herod at dimensional.com
Tue Jul 20 09:55:50 MDT 2004
On Tue, 20 Jul 2004, Shannon Johnston wrote:
> I'm pretty new to the scene of RPM building and I've run into my first
> hurdle. I have an installation of a custom piece of software that does
> not require any compiling, just installation of files. I would like to
> have the installation as an RPM so that I can have it in our yum
> repository. Does anybody have any experience with doing something like
> this?
>
Yes. Here's a sample SPEC file. (I've changed some names to protect the
guilty.) Also, I've learned some more since I first wrote this and
undoubtedly would do a few things differently should I ever need to change
it.
Summary: Herod R1 test and development tools
Name: herod-devtools
Version: 0.2.0
Release: 3
License: Proprietary
Group: Applications/Engineering
URL: http://herod.com/
Source0: %{name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Requires: herod-mfg = 0.2.0
%description
%prep
# Don't do setup if you don't have a tarball to unpack.
# %setup -q
%build
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/herod
install %{_topdir}/../dev-scripts/* $RPM_BUILD_ROOT/etc/sysconfig/herod/
mkdir -p $RPM_BUILD_ROOT/usr/local/sbin
install %{_topdir}/../user-scripts/ver $RPM_BUILD_ROOT/usr/local/sbin/ver
install %{_topdir}/../user-scripts/*.sh $RPM_BUILD_ROOT/usr/local/sbin/
mkdir -p $RPM_BUILD_ROOT/root
install %{_topdir}/../user-scripts/root-bash-profile
$RPM_BUILD_ROOT/root/.bash_profile
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(0744,root,root,0755)
%doc
/etc/sysconfig/herod/resolver-conf.sh
/root/.bash_profile
%defattr(0755,root,root,0755)
/usr/local/sbin/ver
/usr/local/sbin/checkSystem.sh
/usr/local/sbin/cleanshutdown.sh
%post
/etc/sysconfig/herod/resolver-conf.sh install
# We remove the script which disables sshd to re-enable it.
# /etc/sysconfig/herod/turn-off-sshd.sh remove
%preun
/etc/sysconfig/herod/resolver-conf.sh remove
# This turns sshd back off.
# /etc/sysconfig/herod/turn-off-sshd.sh install
%changelog
* Thu Feb 5 2004 Scott Herod <me at my-email> 0.1.0-1
- Initial build.
I build the RPM with the following line in a makefile:
dev_rpm:
cd rpms; rpmbuild -v --define='_topdir '$(CURDIR)'/rpms' -bb \
SPECS/herod-devtools.spec
Scott
More information about the LUG
mailing list