Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] writing an ebuild for btnx
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Norris
n00b
n00b


Joined: 18 Feb 2008
Posts: 4

PostPosted: Mon Feb 18, 2008 2:23 pm    Post subject: [solved] writing an ebuild for btnx Reply with quote

Hi,
I tried to write an ebuild for btnx (http://www.ollisalonen.com/btnx/) and posted my first try in the bugzilla (https://bugs.gentoo.org/show_bug.cgi?id=188265). The ebuild for btnx-0.4.5 is not working yet (for more information you can read my comment in the bugzilla).

But my question is more general:

I think that the Makefile for btnx is not a regular Makefile. For the installation, it is only running a bash script which you can find in another directory. If I use my ebuild I get the error message:

>>> Install btnx-0.4.5 into /var/tmp/portage/app-misc/btnx-0.4.5/image/ category app-misc
Installing btnx...
.ACCESS DENIED mkdir: /etc/btnx
mkdir: kann Verzeichnis „/etc/btnx“ nicht anlegen: Keine Berechtigung

[HINT BY ME: this means "mkdir: couldn'nt create ..., no permission" in english]

Are you root?d not make directory: /etc/btnx.
make: *** [install] Fehler 1

I believe this is the failure:
Because it is a script what is running, emerge does not log this installing it in the work directory and so it don't give the permission to create the directory in the "real" system.

Is there anybody who can help me? Is it possible to say emerge / in the ebuild that it runs a script in the Makefile or to edit the Makefile in the way, that it is running (maybe I can create a diff later)?

Thanks
Jan alias Norris


Last edited by Norris on Thu Dec 02, 2010 1:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
Voltago
Advocate
Advocate


Joined: 02 Sep 2003
Posts: 2593
Location: userland

PostPosted: Mon Feb 18, 2008 7:22 pm    Post subject: Reply with quote

Most properly autotool'ed projects (i. e. where you type ./configure; make; make install) respect the DESTDIR variable, but this package doesn't, and thus tries on 'emake install' to install into the root directory. However, by slightly hacking the install.sh script, this situation can be remedied.
Code:
--- scripts/install.sh   2008-02-18 20:07:31.000000000 +0100
+++ scripts/install.sh   2008-02-18 20:14:06.000000000 +0100
@@ -6,7 +6,7 @@
 # Author: Olli Salonen <oasalonen@gmail.com>   #
 #################################################
 
-INIT_DIR=/etc/init.d
+INIT_DIR=$DESTDIR/etc/init.d
 INIT_PROG=""
 INIT_DEL=
 INIT_ADD=
@@ -15,12 +15,12 @@
 DATA_DIR=data
 DEFAULTS_DIR=$DATA_DIR/defaults
 NAME=btnx
-BIN_DIR=/usr/sbin
+BIN_DIR=$DESTDIR/usr/sbin
 PROGRAM=$BIN_DIR/$NAME
-CONFIG_DIR=/etc/btnx
+CONFIG_DIR=$DESTDIR/etc/btnx
 CONFIG=btnx_config
 EVENTS=events
-
+MKDIR="mkdir -p"
 
 function prompt_yn {
    while [ 1 ]; do
@@ -87,7 +87,7 @@
    echo -ne "."
 else
    #echo -ne "Making config dir... "
-   mkdir $CONFIG_DIR
+   $MKDIR $CONFIG_DIR
    if [ $? -ne 0 ]; then
       echo -e "\n* Error: could not make directory: $CONFIG_DIR. \rAre you root?"
       exit 1
@@ -100,7 +100,7 @@
    echo -ne "."
 else
    #echo -ne "Making bin dir... "
-   mkdir $BIN_DIR
+   $MKDIR $BIN_DIR
    if [ $? -ne 0 ]; then
       echo -e "\n* Error: could not make directory: $BIN_DIR."
       exit 1
@@ -113,7 +113,7 @@
    echo -ne "."
 else
    #echo -ne "Making init dir... "
-   mkdir $INIT_DIR
+   $MKDIR $INIT_DIR
    if [ $? -ne 0 ]; then
       echo -e "\n* Error: could not make directory: $INIT_DIR."
       exit 1

Include this patch into your ebuild in the src_unpack function with the epatch command, and afterwards you can use 'emake DESTDIR=$D install' like normal. If you really want to enter the spirit of gentoo package creation and maintainance, send this small patch upstream with my regards.
Back to top
View user's profile Send private message
Norris
n00b
n00b


Joined: 18 Feb 2008
Posts: 4

PostPosted: Tue Feb 19, 2008 2:30 pm    Post subject: Reply with quote

THANKS!!!

Thank you for your fast answer and working on the install.sh. It works now!
This time, I don't "really want to enter the spirit of gentoo package creation and maintainance".
I only want to bring to the end what I've begun, so I hope it is ok, if I post the patch in the bugzilla
(https://bugs.gentoo.org/show_bug.cgi?id=188265), naturally with your regards.

Hint: emake install or einstall doesn't work, I tested it and I get the same error... but it is not longer relevant...

greetings
Jan alias Norris
Back to top
View user's profile Send private message
srunni
Guru
Guru


Joined: 26 Dec 2007
Posts: 365

PostPosted: Thu Jul 31, 2008 11:46 pm    Post subject: Reply with quote

Hi,

Is there any chance someone could create an ebuild for version 0.4.11?

Thanks!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Fri Aug 01, 2008 3:21 am    Post subject: Reply with quote

srunni wrote:
Is there any chance someone could create an ebuild for version 0.4.11?


Have you tried renaming an ebuild from an existing version? If upstream changes are minimal, a rename is often sufficient to create a working ebuild for the new version. If that did not work, then please provide the output showing how it failed.
Back to top
View user's profile Send private message
baeksu
l33t
l33t


Joined: 26 Sep 2004
Posts: 609
Location: Seoul, Korea

PostPosted: Fri Aug 01, 2008 5:44 am    Post subject: Reply with quote

Hu wrote:
srunni wrote:
Is there any chance someone could create an ebuild for version 0.4.11?


Have you tried renaming an ebuild from an existing version? If upstream changes are minimal, a rename is often sufficient to create a working ebuild for the new version. If that did not work, then please provide the output showing how it failed.


Renaming seems to work. You can change the line:

Code:
RDEPEND=">=app-misc/btnx-config-0.4.7"

to:
Code:
RDEPEND=">=app-misc/btnx-config-0.4.9"


Don't forget to rename 'btnx-config-0.4.7.ebuild' to 'btnx-config-0.4.9.ebuild' as well.

btnx-0.4.11 seems to have added a new configuration option, but I haven't had a chance to test whether this should added as a USE flag as well.
_________________
Gnome:
1. A legendary being.
2. A never ending quest to make unix friendly to people who don't want unix and excruciating for those that do.
Back to top
View user's profile Send private message
Norris
n00b
n00b


Joined: 18 Feb 2008
Posts: 4

PostPosted: Fri Aug 01, 2008 5:50 am    Post subject: Reply with quote

For me, renaming off the ebuild works. Maybe have a look at my comment 20 in the bug posted above.

greets
Jan
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum