diff options
-rw-r--r-- | Makefile | 66 | ||||
-rw-r--r-- | packaging/fedora-doc-common.spec | 55 |
2 files changed, 121 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a2da1ca --- /dev/null +++ b/Makefile @@ -0,0 +1,66 @@ +############################################################################### +# Makefile for fedora-doc-common packaging +# Created by: Paul W. Frields <stickster@gmail.com> +# License: GPL +# Copyright 2005 Paul W. Frields +############################################################################### + +DOCBASE = fedora-doc-common + +###################################################### +# Some packaging specific vars +VERSION = 0.1 +RELEASE = cvs$(shell date +"%Y%m%d") +DATE = $(shell date +"%Y-%m-%d") +NOW = $(shell date +"%a %b %e %Y") +SPECIN = ../docs-common/packaging/$(DOCBASE).spec +DOCSPEC = $(PWD)/SPECS/$(DOCBASE).spec +DOCSRCTAR = $(PWD)/SOURCES/$(DOCBASE)-$(RELEASE).src.tar.gz +TITLE = Fedora Documentation Project Shared Files +###################################################### +# Some RPM flags... +###################################################### +RPMFLAGS = --define "docbase $(DOCBASE)" \ + --define "version $(VERSION)" \ + --define "release $(RELEASE)" \ + --define "_topdir $(PWD)" +###################################################### + + +clean: + rm -rf $(DOCBASE)*.rpm + +update: clean + cvs update + +rpm: update +# +# Make RPM-compliant tarball of source XML and other stuff + mkdir $(DOCBASE)-$(RELEASE) + find . -maxdepth 1 -type d \( \ + -name 'common' -o \ + -name 'css' -o \ + -name 'stylesheet-images' \) | xargs -i \ + find {} -maxdepth 1 -type f ! \( \ + -name '.*' -o -name '*~' -o \ + -name '*.svg' -o -name '*.eps' \) | \ + cpio -pamdv $(DOCBASE)-$(RELEASE) +# +# Make RPM build tree; don't rely on local user's setup + mkdir -p {BUILD,RPMS/noarch,SOURCES,SPECS,SRPMS} + tar -zcvf $(DOCSRCTAR) $(DOCBASE)-$(RELEASE) + cp $(SPECIN) $(DOCSPEC) + rm -rf $(DOCBASE)-$(RELEASE)/ +# +# Make rpmlint happy with a changelog entry +# FIXME: Maybe more magic would make this stickier; pity +# I'm no magician... + sed 's/\(%changelog\)/\1\n* $(NOW) Fedora Docs Project <fedora-docs-list@redhat.com> - $(VERSION)-$(RELEASE)\n- Update to $(RELEASE)\n/' \ + $(SPECIN) > $(DOCSPEC) +# +# Do the build... +# + rpmbuild -bb $(RPMFLAGS) $(DOCSPEC) + mv RPMS/noarch/*.rpm . + rpmbuild --clean --rmsource $(RPMFLAGS) $(DOCSPEC) + rm -rf {BUILD,RPMS,SOURCES,SPECS,SRPMS} diff --git a/packaging/fedora-doc-common.spec b/packaging/fedora-doc-common.spec new file mode 100644 index 0000000..263f4be --- /dev/null +++ b/packaging/fedora-doc-common.spec @@ -0,0 +1,55 @@ +# This spec file is only for building supporting common files from the +# docs-common module. It is not for use with other docs modules at +# this time. + +Summary: Fedora Documentation common files +Name: fedora-doc-common +# To be defined in Makefile +Version: %version +Release: %release +License: FDL +Url: http://fedora.redhat.com/projects/docs/ +Source0: fedora-doc-common-%release.src.tar.gz +Group: Documentation +BuildArch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-root + + +%description +This package contains the common entities and XML fragments for +official Fedora Documentation. + + +%prep +%setup -q -n %{name}-%{release} + + +%build + + +%install +rm -rf $RPM_BUILD_ROOT +install -d -m 755 $RPM_BUILD_ROOT/%{_datadir}/fedora/doc/docs-common/common/ +install -m 644 $RPM_BUILD_DIR/%{name}-%{release}/common/*.{xml,ent} \ + $RPM_BUILD_ROOT/%{_datadir}/fedora/doc/docs-common/common/ +install -d -m 755 $RPM_BUILD_ROOT/%{_datadir}/fedora/doc/docs-common/css/ +install -m 644 $RPM_BUILD_DIR/%{name}-%{release}/css/* \ + $RPM_BUILD_ROOT/%{_datadir}/fedora/doc/docs-common/css/ +install -d -m 755 $RPM_BUILD_ROOT/%{_datadir}/fedora/doc/docs-common/stylesheet-images/ +install -m 644 $RPM_BUILD_DIR/%{name}-%{release}/stylesheet-images/* \ + $RPM_BUILD_ROOT/%{_datadir}/fedora/doc/docs-common/stylesheet-images/ + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-, root, root,-) +%docdir %{_datadir}/fedora/doc/docs-common/common/ +%{_datadir}/fedora/doc/docs-common/common/* +%{_datadir}/fedora/doc/docs-common/css/* +%{_datadir}/fedora/doc/docs-common/stylesheet-images/* + + +%changelog |