Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently i have the following spec file to create a RPM. The spec file is generated by maven plugin to produce a RPM out of it. The question is: will i find files which are mentioned in the spec file after the rpm generation inside the BUILDROOT/SPECS/SOURCES/SRPMS structure?

%define _unpackaged_files_terminate_build 0
Name: rpm-1
Version: 1.0
Release: 1
Summary: rpm-1
License: 2009 my org
Distribution: My App
Vendor: my org
Group: Application/Collectors
Packager: my org
Provides: project
Requires: /bin/sh
Requires: jre >= 1.5
PreReq: dependency
Obsoletes: project
autoprov: yes
autoreq: yes
BuildRoot: /home/build/.jenkins/jobs/rpm-maven-plugin/workspace/target/it/rpm-1/target/rpm/rpm-1/buildroot


if [ -e $RPM_BUILD_ROOT ];
  mv /home/build/.jenkins/jobs/rpm-maven-plugin/workspace/target/it/rpm-1/target/rpm/rpm-1/tmp-buildroot/* $RPM_BUILD_ROOT
  mv /home/build/.jenkins/jobs/rpm-maven-plugin/workspace/target/it/rpm-1/target/rpm/rpm-1/tmp-buildroot $RPM_BUILD_ROOT

ln -s /usr/myusr/app $RPM_BUILD_ROOT/usr/myusr/app2
ln -s /tmp/myapp/somefile $RPM_BUILD_ROOT/tmp/myapp/somefile2
ln -s $RPM_BUILD_ROOT/usr/myusr/app/bin/

%dir  "/usr/myusr/app"
%attr(755,myuser,mygroup)  "/usr/myusr/app/bin/"
%attr(755,myuser,mygroup)  "/usr/myusr/app/bin/filter-version.txt"
%attr(755,myuser,mygroup)  "/usr/myusr/app/bin/"
%attr(755,myuser,mygroup)  "/usr/myusr/app/bin/"
%attr(755,myuser,mygroup)  "/usr/myusr/app/bin/filter.txt"
%attr(755,myuser,mygroup)  "/usr/myusr/app/bin/"
%dir  "/usr/myusr/app/conf"
%config   "/usr/myusr/app/conf/log4j.xml"

echo "hello from prepare"

%pre -p /bin/sh

if [ -s "/etc/init.d/myapp" ]
    /etc/init.d/myapp stop
    rm /etc/init.d/myapp


#create soft link script to services directory
ln -s /usr/myusr/app/bin/ /etc/init.d/myapp

chmod 555 /etc/init.d/myapp


#the argument being passed in indicates how many versions will exist
#during an upgrade, this value will be 1, in which case we do not want to stop
#the service since the new version will be running once this script is called
#during an uninstall, the value will be 0, in which case we do want to stop 
#the service and remove the /etc/init.d script.
if [ "$1" = "0" ]
    if [ -s "/etc/init.d/myapp" ]
        /etc/init.d/myapp stop
        rm /etc/init.d/myapp

%triggerin -- dependency, dependency1
echo "hello from install"

* Tue May 23 2000 Vincent Danen <> 0.27.2-2mdk
-update BuildPreReq to include rep-gtk and rep-gtkgnome
* Thu May 11 2000 Vincent Danen <> 0.27.2-1mdk
* Thu May 11 2000 Vincent Danen <> 0.27.1-2mdk
-added BuildPreReq
-change name from Sawmill to Sawfish

The problem i found is that the files (filter.txt in particular) after the generation process on a Ubuntu system but not on SuSE system. Which might be caused by different rpm versions ? Currently we have an integration test which fails based on the non existing of the file (filter.txt under a buildroot folder?)

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.