# $Id: ITO.spec,v 1.2 2010/12/02 19:34:08 ksb Exp $ # %% 4dd http://rpm.org/max-rpm/ %% # %% dd http://rpm5.org/docs/api/conditionalbuilds.html %% # %% dd http://www.gurulabs.com/GURULABS-RPM-LAB/GURULABS-RPM-GUIDE-v1.0.PDF # %% dd note that a cmd-line --define 'x value' does NOT override this file %% %% check manual pages for $DESTDIR prefix on mk marker Install/Deinstall %% # $KeyFile: ${echo:-echo} %%dd this or levle2-file-with-ident-tag%% # $Level2: ${echo:-echo} %%dd this or special_name || .%% # $Level3: ${echo:-echo} %%dd this or name-of-enclosing-level3-package%% %define _tmpdir /tmp %define _local_prefix /usr/local %define _local_bindir %{_local_prefix}/%% bin sbin etc libexec %% %define _local_libdir %{_local_prefix}/lib %% optional %% %define _local_mandir %{_local_prefix}/man/man%%X section(s)%% # for signing of packages #%_signature gpg #%_gpg_name FIXME@example.org # %dist should be defined on the target but in case it isn't we can guess one %define distguess %(cat /etc/{redhat,fedora,suse,ubuntu}-release | sed -e 's/Fedora Core/fc@/; s/Fedora/f@/; s/Red Hat[^0-9]*\(Enterprise|Server\)*[^0-9]*/rhel@/; s/Red Hat[^0-9]*/rh/; s/.*Suse[^0-9]*/se@/; s/Ubuntu[^0-9]*/ubuntu@/; s/@[^0-9]*//;s/\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)/\1_\2/; s/[^0-9]*$//') %{!?dist:%define dist .%{distguess}} # Do not generate debugging packages by default - older versions of rpmbuild # (like RehHat 6.2) choke on the line with the percent in the macro name: # We need a sed spell on RH6.x to "s/\(^.define \)%d/\1d/", Sigh. -- ksb %define debug_package %{nil} Name: %%name%% Version: %%version%% Release: 1%{?dist} BuildRoot: %{_tmpdir}/%{name}-%{version}-%{release} Vendor: NPCGuild.org Summary: NPC tool for %%thing we do%% Group: %%Utilities or "Applications/System"%% License: BSD URL: %% http://patch.example.com/RPMS %% Source: %% http://patch.example.com/tarball/%{name}-%{version}.tgz %% BuildRequires: gcc m4 msrc_base install_base # Autoreq:0 prevents misleading depencies from being generated. Normally, this # is perfectly sane; however, the system is picking up mk directives and # mkcmd directives as well as system depencies. Autoreq: %% 1 or 0 %% Requires: /bin/ksh install_base %%others like perl oue since muxcat %% Provides: %% maybe we provide something else, dd me usually %% %description %% explain who needs this -- this is going into the index web page %% %prep %setup -q %build umask 022 mkdir -p $RPM_BUILD_ROOT/%{_local_bindir} mkdir -p $RPM_BUILD_ROOT/%{_local_mandir} %%check missing/extra%% mkdir -p $RPM_BUILD_ROOT/%{_local_libdir}/%% delete if not libs anything%% %install F=`mktemp -d /var/tmp/bmHMXXXXXX` %% verify Makefile.host builds all absent target dirs man,bin,etc,lib %% mmsrc -y INTO=$F -Cauto.cf -- make DESTDIR=$RPM_BUILD_ROOT install mk -mInstall -D DESTDIR=$RPM_BUILD_ROOT *.man rm -rf $F find $RPM_BUILD_ROOT -type d -depth -name OLD -exec rm -rf \{\} \; %clean # Do not confilct with the next user of the fixed-path build directory [ / != "%{buildroot}" ] && rm -rf "%{buildroot}" %files %defattr(-,root,root) %{_local_bindir}/%{name} %config %{_local_libdir}/%% delete if not libs anything%% %doc %{_local_mandir}/%% delete if not manual pages are instlled%% %changelog %%!!%% date +"* %a %b %d %Y $NAME" - Built the RPM spec file and added it to the msrc cache