Gentoo Archives: gentoo-dev

From: Tod M Neidt <tod@g.o>
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] ebuild question
Date: Thu, 18 Apr 2002 02:16:23
Message-Id: 1019114132.3695.1336.camel@Q.neidt.net
In Reply to: [gentoo-dev] ebuild question by Avi Schwartz
1 Hi!
2
3 On Thu, 2002-04-18 at 01:13, Avi Schwartz wrote:
4 > I am trying to create an ebuild for wingide. I have couple of problems
5 > I trying to solve here:
6 >
7 > 1. The name of the archive is wingide-1.1.3-1.tar.gz. I tried to call
8 > the ebuild file wingide-1.1.3-1.ebuild but ebuild doesn't like it since
9 > it thinks there are two version numbers. So I changed the name to
10 > wingide-1.1.3-r1.ebuild and I am sticking the -1 in the code:
11
12 I would name the ebuild: wingide-1.1.3.1.ebuild
13
14 You then have two options:
15
16 1. Hardcode the actual tarball name, i.e.
17
18 MYP=${PN}-1.1.3-1
19
20 2. Munge ${P} for the same result, i.e.
21
22 #Grab least significant version number
23 LSV=${PV##*.)
24 #Grab the rest
25 MYPV=${PV%.*}
26 #add the lsv back on
27 MYPV=${MYPV}-${LSV}
28 MYP=${PN}-{MYPV}
29
30 There might be a more elegant munge, but that should work (although you
31 should test it if you use it)
32
33 Either way, use ${MYP} and ${MYPV} in the SRC_URI where you would
34 normally use ${P} and ${PV}.
35
36 Method number 2 (the munge) makes the ebuild version independent.
37
38 SRC_URI="ftp://ftp.wingide.com/pub/wingide/${PV}/${MYP}.tar.gz
39
40 ftp://ftp.wingide.com/pub/wingide/${PV}/bugfix/macro-bugfix-all-${MYPV}.tar etc"
41 SRC_URI="ftp://ftp.wingide.com/pub/wingide/${PV}/${P}-1.tar.gzftp://ftp.wingide.com/pub/wingide/${PV}/bugfix/macro-bugfix-all-${PV}-1.tar ftp://ftp.wingide.com/pub/wingide/${PV}/bugfix/print-bugfix-all-${PV}-1.tar ftp://ftp.wingide.com/pub/wingide/${PV}/bugfix/reuse-app-instance-all-${PV}-1.tar"
42
43
44
45 >
46 > SRC_URI="ftp://ftp.wingide.com/pub/wingide/${PV}/${P}-1.tar.gzftp://ftp.wingide.com/pub/wingide/${PV}/bugfix/macro-bugfix-all-${PV}-1.tar ftp://ftp.wingide.com/pub/wingide/${PV}/bugfix/print-bugfix-all-${PV}-1.tar ftp://ftp.wingide.com/pub/wingide/${PV}/bugfix/reuse-app-instance-all-${PV}-1.tar"
47 >
48 > Is this an acceptable practice? The problem with this is that if they
49 > come out with a -2 version, it will not be enough to rename the ebuild
50 > file (although the bug fix files are breaking this anyway).
51 >
52 > BTW, PV and ${D} are not documented in the developers HOWTO. What else
53 > is missing?
54
55 Please see 'man 5 ebuild', but note that the syntax of the ebuild
56 example is stale. Use /usr/portage/skel.ebuild as a syntax and style
57 example.
58 >
59 > 2. Wingide comes with its own installation program which can be
60 > controlled through the command line. When its archive is expanded, it
61 > creates a wingide-1.1.3-1 directory in which there is the installation
62 > program and the program files. Ho do I point to the installation
63 > program? I tried the following ${WORKDIR}/${P}-1/wing-install.py, is
64 > this correct?
65 >
66 > 3. The parameters it expects are the installation directory and binary
67 > directory:
68 >
69 > ${WORKDIR}/${P}-1/wing-install.py \
70 > --winghome ${D}/usr/lib/wingide \
71 > --bin-dir ${D}/usr/bin
72 >
73 > again, does this make sense?
74
75 I assume that this is in src_compile?
76
77 Set S=${WORKDIR}/${MYP}
78
79 When src_compile is called ${S} is the current working directory so
80
81 wing-install.py \
82 --winghome ${D}/usr/lib/wingide \
83 --bin-dir ${D}/usr/bin \
84 || die
85
86 should be sufficient (i assume you don't need an obligatory 'python' in
87 front of wing-install.py)
88
89
90
91 >
92 > 4. Another problem I am having is that I see the following messages when
93 > doing the install:
94 >
95 > >>> Install wingide-1.1.3-r1 into
96 > /var/tmp/portage/wingide-1.1.3-r1/image/ category avi
97 >
98 > but when I look at the image directory I see that it didn't install a
99 > thing
100
101 Two guesses
102
103 1. you need an '=' after you flags above
104
105 2. The wing-install isn't smart enough to check if the directory exists
106 before trying to copy which doesn't tend to work very well, might need a
107
108 dodir /usr/lib/wingide
109 dodir /usr/bin
110
111 before trying to install
112 .
113 >
114 > 5. The last 3 files are archives that have to be extracted over the root
115 > installation directory which will be ${D}/usr/lib/wingide. Again, how
116 > does one achieve this?
117 I'm not follwing you :( Oh wait, are they patches? or something similiar
118
119 >
120 > 6. The compile stage extracts all 4 files while I realy want only the
121 > main file to be extracted since the other 3 need to be extracted over
122 > the installed file. Is there a way to control this? I tried to put my
123 > own code in src_compile(), but ebuild goes ahead and extracts the
124 > archives before executing my code
125
126 Without looking at the package myself, I would just be guessing probably
127 badly :) Ok are you talking about the other files sownloaded from
128 SRC_URI? If so, you probably want to perform this in the src_unpack
129 function which is executed before src_compile. again see 'man 5 ebuild'
130 .
131 >
132 > 7. When the wingide archive is extracted, besides the installation
133 > program there is another tar file extracted which containsall the files.
134 > Another possibility for the installation of the main wingide archive is
135 > to just extract this archive into ${D}/usr/lib. The question is, do I
136 > have to create ${D}/usr/lib if it doesn't exist yet or will ebuild do it
137 > for me?
138 see above
139
140 Hope that helps,
141
142 tod