According to git's own manual:
GIT(1) Git Manual GIT(1) NAME git - the stupid content tracker ...
GIT(1) Git Manual GIT(1) NAME git - the stupid content tracker ...
README.txt runme.sh runscripts.d/ runscripts.d/001_script.sh runscripts.d/002_another_script.sh
README.txt and runme.sh are the only files that exist in the top directory; contents of runscripts.d changes very often, and you don't want to carefully mention each file. To satisfy all our requirements, we will do the following:
rpmbuild --define="%_topdir `pwd`/_build"
%define __jar_repack %{nil}
is a useful trick to avoid searching and repacking jar files. In our case, it just a small speedup, but when you are repacking something like apache-tomcat, it saves a lot of time and does not touch original files.
yum install rpm-build
.
Firstly, create the Makefile for building the RPM.
all: clean mkdir -p _build && \ tar czf runscripts.tgz runscripts.d && \ rpmbuild --define="%_topdir `pwd`/_build" --define "%_sourcedir `pwd`" -bb runme.spec && \ cp _build/RPMS/noarch/*rpm . clean: rm -rf _build runscripts.tgz *rpmNow, the specfile for our noarch RPM. Pre- and post-install scriptlets are omitted:
%define __jar_repack %{nil} Name: runme Version: 1 Release: 1 Summary: Example set of files BuildArch: noarch License: GPL URL: http://plastilinux.blogspot.com Source0: runscripts.tgz Source1: README.txt Source2: runme.sh %description Example noarch rpm %install mkdir -p %{buildroot}/opt/runme tar -C %{buildroot}/opt/runme -xf %SOURCE0 install -m 644 %SOURCE1 %{buildroot}/opt/runme install -m 755 %SOURCE2 %{buildroot}/opt/runme %files %defattr(-, root, root) %dir /opt/runme %dir /opt/runme/runscripts.d /opt/runme/README.txt %attr(755,root,root) /opt/runme/runme.sh %attr(755,root,root) /opt/runme/runscripts.d/*Get all the files from the repo, run "make" and get the ready rpm in two seconds.