1# Copyright (C) 2001-2009 Karsten Reincke <karsten.reincke@fodina.de > 2# 3# This file is free software; as a special exception the author gives 4# unlimited permission to copy and/or distribute it, with or without 5# modifications, as long as this notice is preserved. 6# 7# This program is distributed in the hope that it will be useful, but 8# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the 9# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10# 11# file <prj.spec> version <#3.2.0#> of project <GTGT> 12 13 14############################################################################ 15# (1) internally usable variables (%define ATTRIBUTE VALUE) 16############################################################################ 17 18# (a) increment this number manually before building the next rpm 19%define PRJ_RPMBUILDNR 1 20 21# (b) change this prefix to the locally used top-build-directory 22%define PRJ_BUILD_PREFIX /tmp 23 24# (c) change this prefix to the intended install-prefix of the target machine 25%define PRJ_TARGET_PREFIX /opt/local 26 27# (d) project-name (will automatically be generated by gptg) 28%define PRJ_NAME gtgt 29# (e) project-release (will automatically updated by change-release) 30%define PRJ_RELEASE 3.1.0 31 32# (f) project-source-top-dir (generated by extracting the tarbal) 33%define PRJ_SRCTOPDIR %{PRJ_NAME}-%{PRJ_RELEASE} 34 35# (g) project-source-tarball (generated by make dist) 36%define PRJ_TARBALL %{PRJ_SRCTOPDIR}.tar.gz 37 38# (h) specify the locally used top installation point 39%define PRJ_TOP_INST_DIR %{PRJ_BUILD_PREFIX}/%{PRJ_NAME}-%{PRJ_RELEASE}-buildroot 40 41############################################################################ 42# (2) The preamble contains a wealth of information about the package 43# being built, and the people that built it 44############################################################################ 45 46################################################# 47# (A) change the folowing lines manually # 48################################################# 49# (a) The summary line defines a one-line description pf the packaged softwarte 50Summary: gnu template generation tools 51 52# (b) The copyright line holds the packaged software's copyright information 53Copyright: GPL 54 55# (c) The group line says how the package is grouped with other packages 56Group: Development/Tools 57 58# (d) insert the URL for getting the source-tarball (if possible) 59Source: http://gtgt.sourceforge.net/gtgt-3.0.0.tar.gz 60 61# (e) insert the URL for getting the source-documentation + info (if possible) 62Url: http://gtgt.sourceforge.net/ 63 64# (f) The distribution line contains the name of the product 65# which the packaged software is part of 66Distribution: SUSE 67 68# (g) The vendor line identifies the organization that distributes the software 69Vendor: http://www.fodina.de/ 70 71# (h) The package line identifies the organization that actually packages the software 72Packager: karsten.reincke@fodina.de 73 74BuildRoot: %{PRJ_TOP_INST_DIR} 75 76################################################# 77# (B) don't change the following lines manually # 78################################################# 79 80# (a) The name line defines what the package will actually be called. 81Name: %{PRJ_NAME} 82 83# (b) The version line should be set to the version of the software being packaged 84Version: %{PRJ_RELEASE} 85 86# (c) The release presents the number of times the software has been packaged 87Release: %{PRJ_RPMBUILDNR} 88 89 90Prefix: %{PRJ_TARGET_PREFIX} 91############################################################################ 92# (3) The description should be several sentences describing 93# to an uniformed user, what the software doess 94############################################################################ 95%description 96(General) GNU Template Generation Tools: a set of scripts 97for generating the initial release of a software project 98managed and developed by using the autoconf/automake tools 99 100############################################################################ 101# (4) In the prep-section, the focus is entirely on directing RPM through 102# the process of preparing the software for building 103# (= unpack / collect / checkout all the needed sources). 104# The working directory will implicitely changed onto 105# /usr/src/packages/BUILD by the rpm command itself. 106# If you unpack / collect / checkout anything it is positioned there. 107# You can denote the directory where you've really started the rpm 108# by the variable OLDPWD 109############################################################################ 110%prep 111OSP=$OLDPWD 112ASP=`pwd` 113rm -rf %{BuildRoot} 114cd ${OSP} 115./reconf 116./configure 117make dist 118cd ${ASP} 119if [ -d %{PRJ_SRCTOPDIR} ]; then rm -r %{PRJ_SRCTOPDIR}; fi 120tar -xzvf ${OSP}/%{PRJ_TARBALL} 121 122############################################################################ 123# (5) In the build-section, the focus is entirely on directing RPM through 124# the process of building the software 125############################################################################ 126%build 127cd %{PRJ_SRCTOPDIR} 128./configure --prefix=%{PRJ_TOP_INST_DIR}/%{PRJ_TARGET_PREFIX} 129make 130 131############################################################################ 132# (6) In the install-section, the focus is entirely on directing RPM through 133# the process of installing the software into the directory 134# RPM_BUILD_ROOT which has been set by the variable 'BuildRoot' 135############################################################################ 136%install 137cd %{PRJ_SRCTOPDIR} 138make install 139 140 141############################################################################ 142# (7) In the clean-section, the focus is entirely on directing RPM through 143# the process of deleting the software out of the directory 144# RPM_BUILD_ROOT which has been set by the variable 'BuildRoot' 145############################################################################ 146%clean 147rm -rf %{BuildRoot} 148 149############################################################################ 150# (8) In the file-section, the focus is entirely on saying RPM which of 151# the files, which have been installed under RPM_BUILD_ROOT should 152# be added into the package 153############################################################################ 154%files 155%defattr(-,root,root) 156 157%{PRJ_TARGET_PREFIX} 158