LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-12-2009, 04:26 PM   #1
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 188

Rep: Reputation: 30
Rpmbuild for PHP/Mysql App


Hi,

I'm looking for a way to use rpmbuild to make an rpm of a php/mysql app.

Basically i'll have the php code that must go to the default apache directory, and sqldump that will be imported to a specified database,etc.
Maybe check dependancies as well, i.e check that php,mysql and php-mysqli is installed.

I'm not sure what i'll need in my spec file though. Firstly, is this possible, and if so do i need to make some kind of Makefile? What do i need to add in my prep and build sections of my spec file?

I know i can probably write a shell script that will do everything, but i'll really prefer to have a .rpm file that will do all of this for me.

Any suggestions?

Thnx
 
Old 07-12-2009, 05:48 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by baddah View Post
Firstly, is this possible,
Sure it can be done.


Quote:
Originally Posted by baddah View Post
I'm not sure what i'll need in my spec file though.
Have a look at IBM's "Building RPM packages without being root" part 1 and part 2 (http://www.ibm.com/developerworks/library/l-rpm1/, http://www.ibm.com/developerworks/library/l-rpm2/), Maximum RPM (http://www.rpm.org/max-rpm/), Fedora/RH docs (http://fedoraproject.org/wiki/Packaging/Guidelines and http://docs.fedoraproject.org/drafts...-en/index.html ;-p


Quote:
Originally Posted by baddah View Post
I know i can probably write a shell script that will do everything, but i'll really prefer to have a .rpm file that will do all of this for me.
In short what we need is a tarball that includes all the components that need to go onto the system and the list of commands you would perform to install this app. If you list the tarball contents and the commands we'll build you a .spec file and explain what goes on.
 
Old 07-13-2009, 01:40 AM   #3
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 188

Original Poster
Rep: Reputation: 30
Thanks, i'll have a bash at it, and if i don't get it right i'll come back.
 
Old 07-14-2009, 09:11 AM   #4
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 188

Original Poster
Rep: Reputation: 30
Ok, i think i understand the procedure now for code that needs to be compiled. The prep does the untar, then you build it and finally install it. Under your %files part you then list the compiled code and this gets included into the generated .rpm file.

I'm a bit confused with how to handle php code that just needs to be copied over to the default apache dir,i.e no compiling is needed.

A very trivial example :

I have a tarball HelloWorld-0.0.1.tar.gz with one file Helloworld.php in it. (The tarball is in my BUILD dir and all of that)

I want to generate an rpm so that when i run it, it copies over Helloworld.php to the default apache dir on the box it is installed on.

What would i need in my spec file here? I have tried to put the cp commands in the spec files' install part, but it does not seem to work .

I assume i'm missing the big picture...
 
Old 07-14-2009, 09:18 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Saying "doesn't seem to work" is not like posting the actual error. Posting those may make it way easier to read and understand what's going on. That said: 0) under %install list the proper 'install' command to copy the file from your %source to the $RPM_BUILD_ROOT/path/to/apaches/docroot/ and 1) under %files list the /path/to/apaches/docroot/filename.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
yum install php-mysql fails with mysql 5.1 - "Error: mysql conflicts with MySQL" rebelde Linux - Software 2 03-13-2009 10:32 AM
rpmbuild --with : mysql - unknown option. How to pass extra options to build? fireman949 Red Hat 0 07-06-2005 06:53 PM
Writing an app that uses a mysql database without installing mysql server? QtCoder Programming 4 08-09-2004 02:43 PM
Problem getting PHP to recognize MySQL, Using PHP 4.0 and MySQL 4.0.20 d2army Programming 4 06-27-2004 08:54 PM
rpmbuild -ba php.spec pk21 Linux - General 0 09-16-2003 09:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration