Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 29th March 2012, 10:24 AM
Jamwa Offline
Registered User
 
Join Date: Jan 2008
Location: Nairobi Kenya
Posts: 540
linuxfedorafirefox
Help in creating rpm package

Hello.

I need some help in creating an rpm package for my Fedora boxes. I have never done this before but am following the tutoria at http://fedoraproject.org/wiki/How_to...e#Introduction

This is what I want to do:

I want to create an rpm installation for Drupal (http://drupal.org/)

I have gone so far as to create the spec file:

Code:
Name:           drupal
Version:        6.25
Release:        1%{?dist}
Summary:        Drupal installation RPM

License:        GPLv2+
URL:            http://drupal.org
Source0:        http://ftp.drupal.org/files/projects/%{name}-%{version}.tar.gz

BuildRequires:  mysql
Requires:       mysql

%description
Installation file for drupal database


%prep
%setup -q -c drupal


%build
pwd


%install
ls $RPM_BUILD_ROOT
cp -rp $RPM_BUILD_DIR/%{name}-%{version}/* /var/www/html 

%files
%doc



%changelog
which "compiles" ok:

Code:
$ rpmlint -i drupal.spec 
0 packages and 1 specfiles checked; 0 errors, 0 warnings.
Now the idea when installing is to extract the tarball and copy the files into the folder /var/www/html. No making or configuring anything.

This is what I eventually get:

Code:
$ rpmbuild -ba drupal.spec 
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.7JAG0X
+ umask 022
+ cd /home/makerpm/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /home/makerpm/rpmbuild/BUILD
+ rm -rf drupal-6.25
+ /bin/mkdir -p drupal-6.25
+ cd drupal-6.25
+ /usr/bin/gzip -dc /home/makerpm/rpmbuild/SOURCES/drupal-6.25.tar.gz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.pVDgqG
+ umask 022
+ cd /home/makerpm/rpmbuild/BUILD
+ cd drupal-6.25
+ LANG=C
+ export LANG
+ unset DISPLAY
+ pwd
/home/makerpm/rpmbuild/BUILD/drupal-6.25
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.TupaTo
+ umask 022
+ cd /home/makerpm/rpmbuild/BUILD
+ '[' /home/makerpm/rpmbuild/BUILDROOT/drupal-6.25-1.fc16.i386 '!=' / ']'
+ rm -rf /home/makerpm/rpmbuild/BUILDROOT/drupal-6.25-1.fc16.i386
++ dirname /home/makerpm/rpmbuild/BUILDROOT/drupal-6.25-1.fc16.i386
+ mkdir -p /home/makerpm/rpmbuild/BUILDROOT
+ mkdir /home/makerpm/rpmbuild/BUILDROOT/drupal-6.25-1.fc16.i386
+ cd drupal-6.25
+ LANG=C
+ export LANG
+ unset DISPLAY
+ ls /home/makerpm/rpmbuild/BUILDROOT/drupal-6.25-1.fc16.i386
+ cp -rp /home/makerpm/rpmbuild/BUILD/drupal-6.25/drupal-6.25 /var/www/html
cp: cannot create directory `/var/www/html/drupal-6.25': Permission denied
error: Bad exit status from /var/tmp/rpm-tmp.TupaTo (%install)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.TupaTo (%install)

Help please
Reply With Quote
  #2  
Old 29th March 2012, 10:35 AM
satanselbow Offline
Registered User
 
Join Date: Apr 2011
Location: Upminster, Essex, UK
Posts: 169
linuxchrome
Wink Re: Help in creating rpm package

De-compiling a phpmyadmin rpm will give you everything you need
Reply With Quote
  #3  
Old 29th March 2012, 11:58 AM
Jamwa Offline
Registered User
 
Join Date: Jan 2008
Location: Nairobi Kenya
Posts: 540
linuxfedorafirefox
Re: Help in creating rpm package

OK, I have followed your clue and have changed the spec file a bit:

Code:
Name:           drupal
Version:        6.25
Release:        1%{?dist}
Summary:        Drupal installation RPM

License:        GPLv2+
URL:            http://drupal.org
Source:        http://ftp.drupal.org/files/projects/%{name}-%{version}.tar.gz

Packager: Me <me@me.com>
Vendor: Fedora Yum Repository, http://www.fedoraproject.org

BuildArch: noarch
BuildRequires:  mysql >= 4.1.0
Requires:       mysql >= 4.1.0

%description
Installation file for drupal database


%prep
%setup -n drupal-%{version}


%build


%install

%{__rm} -rf %{buildroot}

%{__install} -d -m 0755 %{buildroot}%{_datadir}/drupal/
%{__cp} -av * %{buildroot}%{_datadir}/drupal/

%clean
%{__rm} -rf %{buildroot}

%files
%doc /usr/share/drupal/*
Good news is that the rpm is created fine. Hooray to that

Bad news is that the files are installed (extracted) to /usr/share/drupal/ What do I do to get it to extract to /var/www/html?

Code:
$rpmls /home/makerpm/rpmbuild/RPMS/noarch/drupal-6.25-1.fc16.noarch.rpm 
-rw-r--r--  /usr/share/drupal/CHANGELOG.txt
-rw-r--r--  /usr/share/drupal/COPYRIGHT.txt
-rw-r--r--  /usr/share/drupal/INSTALL.mysql.txt
-rw-r--r--  /usr/share/drupal/INSTALL.pgsql.txt
-rw-r--r--  /usr/share/drupal/INSTALL.txt
-rw-r--r--  /usr/share/drupal/LICENSE.txt
-rw-r--r--  /usr/share/drupal/MAINTAINERS.txt
-rw-r--r--  /usr/share/drupal/UPGRADE.txt
-rw-r--r--  /usr/share/drupal/cron.php
drwxr-xr-x  /usr/share/drupal/includes
-rw-r--r--  /usr/share/drupal/includes/actions.inc
-rw-r--r--  /usr/share/drupal/includes/batch.inc
-rw-r--r--  /usr/share/drupal/includes/bootstrap.inc
//SNIP
-rw-r--r--  /usr/share/drupal/themes/pushbutton/tabs-on-rtl.png
-rw-r--r--  /usr/share/drupal/themes/pushbutton/tabs-on.png
-rw-r--r--  /usr/share/drupal/themes/pushbutton/tabs-option-hover-rtl.png
-rw-r--r--  /usr/share/drupal/themes/pushbutton/tabs-option-hover.png
-rw-r--r--  /usr/share/drupal/themes/pushbutton/tabs-option-off-rtl.png
-rw-r--r--  /usr/share/drupal/themes/pushbutton/tabs-option-off.png
-rw-r--r--  /usr/share/drupal/themes/pushbutton/tabs-option-on.png
-rw-r--r--  /usr/share/drupal/update.php
-rw-r--r--  /usr/share/drupal/xmlrpc.php
$
Reply With Quote
  #4  
Old 29th March 2012, 01:20 PM
satanselbow Offline
Registered User
 
Join Date: Apr 2011
Location: Upminster, Essex, UK
Posts: 169
linuxchrome
Wink Re: Help in creating rpm package

Again referring to the phpmyadmin example - take a look at the .conf files on how to setup the apache aliases and permissions
Reply With Quote
  #5  
Old 29th March 2012, 01:59 PM
Jamwa Offline
Registered User
 
Join Date: Jan 2008
Location: Nairobi Kenya
Posts: 540
linuxfedorafirefox
Re: Help in creating rpm package

Thank you very very very much :-)

The final spec file is this:

Code:
%define	_datadir /var/www/html

Name:           drupal
Version:        6.25
Release:        1.1%{?dist}
Summary:        Drupal installation RPM

License:        GPLv2+
URL:            http://drupal.org
Source:        http://ftp.drupal.org/files/projects/%{name}-%{version}.tar.gz

Packager: Me <me@me.com>
Vendor: Fedora Yum Repository, http://www.fedoraproject.org

BuildArch: noarch
BuildRequires:  mysql >= 4.1.0
Requires:       mysql >= 4.1.0
Requires:       php >= 4.1.0


%description
Installation file for drupal database


%prep
%setup -n drupal-%{version}


%build


%install
%{__rm} -rf %{buildroot}

%{__install} -d -m 0755 %{buildroot}%{_datadir}/%{name}
%{__cp} -av * %{buildroot}%{_datadir}/%{name}

%clean
%{__rm} -rf %{buildroot}

%files
%doc
%{_datadir}/%{name}/*
Reply With Quote
Reply

Tags
creating, package, rpm

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Package List LinuxLuvr Using Fedora 1 3rd January 2010 04:04 PM
Package Kit Installed 64 Bit Wine Package into a 32 Bit Base Install dd_wizard Using Fedora 0 23rd November 2009 10:15 PM
how to add customized rpm package in kickcstart's %package ,not in the %post liqin Installation and Live Media 0 30th June 2008 02:52 PM
FC6 fails during package installation ~or~ package dependency check Lord Kage EOL (End Of Life) Versions 0 29th April 2007 06:37 AM
RPM package creating. RPATH issue(s). TranzeManiaC Programming & Packaging 5 11th March 2006 01:55 PM


Current GMT-time: 18:19 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat