LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 08-08-2007, 11:46 AM   #1
utahnix
Member
 
Registered: Dec 2006
Location: Utah, USA
Distribution: openSUSE
Posts: 72

Rep: Reputation: 15
Making rpms from already compiled source directory


Okay...

So I have this window decoration for KDE that I've compiled from source. I had to use specific configure parameters to make it work. I want to make an rpm from this, and have never produced an rpm.

Is there an easy way to make an rpm directly from my configure script and source directory I've already compiled?
 
Old 08-08-2007, 12:46 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
If it's possible, you could probably get the information you need from the Red Hat website, under Documentation. There is a book called Maximun RPM. See chapters 10, 11, and 13.

The book used to be available to read online or to download. I don't know it that is still the case.
 
Old 08-08-2007, 02:09 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,693
Blog Entries: 54

Rep: Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961
The basics are pretty simple, and there's two ways. The "lame" way would be to install your package into an isolated root (say /tmp/packagename), make a tarball and build a spec for that (this type of package should not ever be distributed). The usual way is to add the ./configure, make and install details to the .spec file and build the RPM.

If you're feeling adventurous and you've got a wee bit of time then post the name, version and D/L URI of the package, your configure, make and install details and the output of "make -n install" and we'll see if we can turn it into a working .spec file.
 
Old 08-09-2007, 12:18 PM   #4
utahnix
Member
 
Registered: Dec 2006
Location: Utah, USA
Distribution: openSUSE
Posts: 72

Original Poster
Rep: Reputation: 15
Package location:
http://www.kde-look.org/content/show...?content=48318

Configure:
./configure --prefix='/opt/kde3' --libdir='/opt/kde3/lib64' --with-qt-libraries='/usr/lib/qt3/lib64'

Standard 'make' and 'make install'. Nothing fancy there.

This is the output of make -n install:

set fnord $MAKEFLAGS; amf=$2; \
dot_seen=no; \
target=`echo install-recursive | sed s/-recursive//`; \
list='kwin'; for subdir in $list; do \
echo "Making $target in $subdir"; \
if test "$subdir" = "."; then \
dot_seen=yes; \
local_target="$target-am"; \
else \
local_target="$target"; \
fi; \
(cd $subdir && make $local_target) \
|| case "$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$dot_seen" = "no"; then \
make "$target-am" || exit 1; \
fi; test -z "$fail"
Making install in kwin
make[1]: Entering directory `/home/user/humanblue-0.3/kwin'
set fnord $MAKEFLAGS; amf=$2; \
dot_seen=no; \
target=`echo install-recursive | sed s/-recursive//`; \
list='. config'; for subdir in $list; do \
echo "Making $target in $subdir"; \
if test "$subdir" = "."; then \
dot_seen=yes; \
local_target="$target-am"; \
else \
local_target="$target"; \
fi; \
(cd $subdir && make $local_target) \
|| case "$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$dot_seen" = "no"; then \
make "$target-am" || exit 1; \
fi; test -z "$fail"
Making install in .
make[2]: Entering directory `/home/user/humanblue-0.3/kwin'
make install-exec-am install-data-am
make[3]: Entering directory `/home/user/humanblue-0.3/kwin'
make[3]: Nothing to be done for `install-exec-am'.
:
test -z "/opt/kde3/lib64/kde3" || mkdir -p -- . "/opt/kde3/lib64/kde3"
list='kwin3_humanblue.la'; for p in $list; do \
if test -f $p; then \
f="`echo $p | sed -e 's|^.*/||'`"; \
echo " /bin/sh ../libtool --silent --mode=install /usr/bin/install -c -p '$p' '/opt/kde3/lib64/kde3/$f'"; \
/bin/sh ../libtool --silent --mode=install /usr/bin/install -c -p "$p" "/opt/kde3/lib64/kde3/$f"; \
else :; fi; \
done
:
test -z "/opt/kde3/share/apps/kwin" || mkdir -p -- . "/opt/kde3/share/apps/kwin"
list='humanblue.desktop'; for p in $list; do \
if test -f "$p"; then d=; else d="./"; fi; \
f="`echo $p | sed -e 's|^.*/||'`"; \
echo " /usr/bin/install -c -p -m 644 '$d$p' '/opt/kde3/share/apps/kwin/$f'"; \
/usr/bin/install -c -p -m 644 "$d$p" "/opt/kde3/share/apps/kwin/$f"; \
done
make[3]: Leaving directory `/home/user/humanblue-0.3/kwin'
make[2]: Leaving directory `/home/user/humanblue-0.3/kwin'
Making install in config
make[2]: Entering directory `/home/user/humanblue-0.3/kwin/config'
make install-exec-am install-data-am
make[3]: Entering directory `/home/user/humanblue-0.3/kwin/config'
:
test -z "/opt/kde3/lib64/kde3" || mkdir -p -- . "/opt/kde3/lib64/kde3"
list='kwin_humanblue_config.la'; for p in $list; do \
if test -f $p; then \
f="`echo $p | sed -e 's|^.*/||'`"; \
echo " /bin/sh ../../libtool --silent --mode=install /usr/bin/install -c -p '$p' '/opt/kde3/lib64/kde3/$f'"; \
/bin/sh ../../libtool --silent --mode=install /usr/bin/install -c -p "$p" "/opt/kde3/lib64/kde3/$f"; \
else :; fi; \
done
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/home/user/humanblue-0.3/kwin/config'
make[2]: Leaving directory `/home/user/humanblue-0.3/kwin/config'
make[1]: Leaving directory `/home/user/humanblue-0.3/kwin'
make[1]: Entering directory `/home/user/humanblue-0.3'
if test ! -f config.h; then \
rm -f stamp-h1; \
make stamp-h1; \
else :; fi
make install-exec-am install-data-am
make[2]: Entering directory `/home/user/humanblue-0.3'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/user/humanblue-0.3'
make[1]: Leaving directory `/home/user/humanblue-0.3'
 
Old 08-10-2007, 01:55 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,693
Blog Entries: 54

Rep: Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961
Code:
%define name humanblue
# Version
%define ver 0.3
# Release
%define rel 1
%define debug_packages	%{nil}
%define debug_package %{nil}

Name: %{name}
Summary: Human Blue native deco for KDE
Version: %{ver}
Release: %{rel}
License: GPL
Packager: packager <packager@ho.st>
Group: X11/Window Managers
Source0: %{name}-%{ver}.tar.gz
Provides: %{name}
Vendor: none
URL: http://www.kde-look.org/
BuildRoot: %{_tmppath}/%{name}-%{version}

%description
Human Blue native deco for KDE

%prep

%setup -q

%build

%configure --prefix=/opt/kde3 --libdir=/opt/kde3/lib64 --with-qt-libraries=/usr/lib/qt3/lib64
	
make


%install
if [ "$RPM_BUILD_ROOT" = "/tmp/%{name}-broot" ]; then
	rm -rf $RPM_BUILD_ROOT
	make install
else
	echo Invalid Build root \'"$RPM_BUILD_ROOT"\'
	exit 1
fi

						
%clean
if [ "$RPM_BUILD_ROOT" = "/tmp/%{name}-broot" ]; then
	rm -rf $RPM_BUILD_ROOT
else
	echo Invalid Build root \'"$RPM_BUILD_ROOT"\'
	exit 1
fi


%files
%defattr(-,root,root)
%attr(644,root,root) /opt/kde3/lib64/kde3/kwin3_humanblue.la
%attr(644,root,root) /opt/kde3/share/apps/kwin/humanblue.desktop
%attr(644,root,root) /opt/kde3/lib64/kde3/kwin_humanblue_config.la

%changelog
* Sat Jan 01 1999 packager <packager@ho.st>
- Add spec etc etc.
 
Old 08-10-2007, 11:30 AM   #6
utahnix
Member
 
Registered: Dec 2006
Location: Utah, USA
Distribution: openSUSE
Posts: 72

Original Poster
Rep: Reputation: 15
I saved the spec file you created and then run the command:

rpmbuild -ba humanblue.spec

It went along fine until it hit this:

make[3]: Leaving directory `/usr/src/packages/BUILD/humanblue-0.3/kwin/config'
make[2]: Leaving directory `/usr/src/packages/BUILD/humanblue-0.3/kwin'
make[2]: Entering directory `/usr/src/packages/BUILD/humanblue-0.3'
make[2]: Leaving directory `/usr/src/packages/BUILD/humanblue-0.3'
make[1]: Leaving directory `/usr/src/packages/BUILD/humanblue-0.3'
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.65347
+ umask 022
+ cd /usr/src/packages/BUILD
+ cd humanblue-0.3
+ '[' /var/tmp/humanblue-0.3 = /tmp/humanblue-broot ']'
+ echo Invalid Build root ''\''/var/tmp/humanblue-0.3'\'''
Invalid Build root '/var/tmp/humanblue-0.3'
+ exit 1
error: Bad exit status from /var/tmp/rpm-tmp.65347 (%install)


RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.65347 (%install)
 
Old 08-12-2007, 05:35 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,693
Blog Entries: 54

Rep: Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961
Change the line
Code:
if [ "$RPM_BUILD_ROOT" = "/tmp/%{name}-broot" ]; then
to read
Code:
if [ "$RPM_BUILD_ROOT" = "/var/tmp/%{name}-%{version}" ]; then
 
Old 08-13-2007, 11:52 AM   #8
utahnix
Member
 
Registered: Dec 2006
Location: Utah, USA
Distribution: openSUSE
Posts: 72

Original Poster
Rep: Reputation: 15
I made the line change, but it ended the same way. So for kicks and giggles I ran the whole rpmbuild process under sudo, to see what I got. I generally don't think building as root is a good idea, but I figured it would let me know if permissions were the culprit.

I got this (I'm not sure what to make of it):

I call /usr/sbin/Check...
+ /usr/sbin/Check
-r--r--r-- 1 root root 5446 Apr 30 15:46 /usr/share/man/man3/VMware::VmPerl::VM.3pm.gz
-r--r--r-- 1 root root 2800 Apr 30 15:46 /usr/share/man/man3/VMware::VmPerl::Server.3pm.gz
-r--r--r-- 1 root root 2120 Apr 30 15:46 /usr/share/man/man3/VMware::VmPerl::Question.3pm.gz
-r--r--r-- 1 root root 4894 Mar 7 18:30 /usr/share/man/man3/Net::IMAP::Simple.3pm.gz
-r--r--r-- 1 root root 2472 Apr 30 15:46 /usr/share/man/man3/VMware::VmPerl::ConnectParams.3pm.gz
-r--r--r-- 1 root root 2907 Apr 30 15:46 /usr/share/man/man3/VMware::VmPerl.3pm.gz
-rw-r--r-- 1 root root 10523 Jan 5 2007 /usr/local/man/man1/imwheel.1.gz
+ /usr/lib/rpm/brp-compress
/usr/lib/rpm/brp-compress: line 12: cd: /var/tmp/humanblue-0.3: No such file or directory
+ /usr/lib/rpm/brp-symlink
/usr/lib/rpm/brp-symlink: line 31: cd: /var/tmp/humanblue-0.3: No such file or directory
Processing files: humanblue-0.3-1
error: File not found: /var/tmp/humanblue-0.3/opt/kde3/lib64/kde3/kwin3_humanblue.la
error: File not found: /var/tmp/humanblue-0.3/opt/kde3/share/apps/kwin/humanblue.desktop
error: File not found: /var/tmp/humanblue-0.3/opt/kde3/lib64/kde3/kwin_humanblue_config.la


RPM build errors:
File not found: /var/tmp/humanblue-0.3/opt/kde3/lib64/kde3/kwin3_humanblue.la
File not found: /var/tmp/humanblue-0.3/opt/kde3/share/apps/kwin/humanblue.desktop
File not found: /var/tmp/humanblue-0.3/opt/kde3/lib64/kde3/kwin_humanblue_config.la
 
Old 08-14-2007, 01:26 PM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,693
Blog Entries: 54

Rep: Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961
OK, I see. Instead of "make install" it will be one of "make install DEST=${RPM_BUILD_ROOT}" or "make INSTALL_PREFIX=$RPM_BUILD_ROOT install" or "make install DESTDIR=%{buildroot}".
 
Old 08-14-2007, 07:22 PM   #10
utahnix
Member
 
Registered: Dec 2006
Location: Utah, USA
Distribution: openSUSE
Posts: 72

Original Poster
Rep: Reputation: 15
I tried the first two suggestions and I got no change in results. The third one got me farther, but hung up here:


Processing files: humanblue-0.3-1
error: File not found: /var/tmp/humanblue-0.3/opt/kde3/share/apps/kwin/humanblue.desktop


RPM build errors:
File not found: /var/tmp/humanblue-0.3/opt/kde3/share/apps/kwin/humanblue.desktop
 
Old 08-15-2007, 02:28 AM   #11
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,693
Blog Entries: 54

Rep: Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961
Hmm. Locate it in the (sub)dir(s) of where you run "make" or locate it in the ${RPM_BUILD_ROOT} (sub)dir(s) and add a custom 'install' line beneath the "make install" line for it?
 
  


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
Mixing RPMs and self-compiled application Swakoo Linux - Server 4 06-20-2007 05:23 AM
Making RPMs? Eklipz Fedora 5 11-23-2004 09:48 AM
Making RPMs from tar.gz pembo13 Linux - Software 2 09-10-2004 08:09 AM
rpms source directory-needed for nvidia installer so noob Mandriva 4 06-13-2004 07:21 AM
Making RPMs Gene Barrie Linux - General 1 01-04-2003 02:18 PM


All times are GMT -5. The time now is 04:27 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration