문제

I need to make a very simple rpm to extract a tar.gz and to put its contents in /var/www without doing anything else.

I have a .spec that is supposed to do that, but it fails with a non verbose error.

rpmlint does not throw an error.

Here goes the spec:

Name:           redmine
Version:        2.4.3
Release:        1%{?dist}
Summary:        A flexible project management web application

Group:          Development/Tools/Other
License:        GPL-2.0
URL:            http://www.redmine.org/
Source0:        %{name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  gcc
Requires:       httpd

%description

Redmine is a flexible project management web application.
Written using Ruby on Rails framework, it is cross-platform and cross-database.
%prep
%setup

%build

%install
rm -rf %{buildroot}
mkdir -p /var/www/redmine/
install -m 0755 * /var/www/redmine/
mkdir -p /var/www/redmine/tmp/

%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
/var/www/redmine/*
/var/www/redmine/app/*
/var/www/redmine/config/*
/var/www/redmine/db/*
/var/www/redmine/doc/*
/var/www/redmine/extra/*
/var/www/redmine/lib/*
/var/www/redmine/plugins/*
/var/www/redmine/public/*
/var/www/redmine/script/*
/var/www/redmine/test/*
/var/www/redmine/tmp/*
/var/www/redmine/vendor/*
%defattr(-,apache,apache,-)
/var/www/redmine/tmp/*
/var/www/redmine/files/*
/var/www/redmine/log/*

%post
echo " "
echo "installatios was successful"

And this is the last part of the error message:

+ rm -rf /root/rpmbuild/BUILDROOT/redmine-2.4.3-1.el6.i386
+ mkdir -p /var/www/redmine/
+ install -m 0755 CONTRIBUTING.md Gemfile README.rdoc Rakefile app config config.ru db doc extra files lib log plugins public script test tmp vendor /var/www/redmine/
install: omitting directory `app'
install: omitting directory `config'
install: omitting directory `db'
install: omitting directory `doc'
install: omitting directory `extra'
install: omitting directory `files'
install: omitting directory `lib'
install: omitting directory `log'
install: omitting directory `plugins'
install: omitting directory `public'
install: omitting directory `script'
install: omitting directory `test'
install: omitting directory `tmp'
install: omitting directory `vendor'
error: Bad exit status from /var/tmp/rpm-tmp.FwRGmu (%install)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.FwRGmu (%install)
도움이 되었습니까?

해결책 2

install doesn't work on directories. Use it to create the directories and then use cp to copy the contents.

다른 팁

There are many problems with this .spec file. Here are some big ones:

  1. Absolute path in %install - this makes it need root to build (a no-no) and can stomp on anything that the build machine already has installed on it. If you're trying to copy the config from a machine, tar up the files you want.
  2. No source files. See above - you wouldn't be able to have a .src RPM.
  3. You don't own the directories in the files lists (%dir).
  4. RPMs should not touch /var/www/ - see Fedora Packaging Guidelines.
  5. Name conflict - don't name it redmine if it is your specific config. Instead, Requires a standard redmine package and name yours something like redmine-companyname-config. Or use that name and have it Obsoletes and Provides the original redmine if you must.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top