makepkg is creating BOTH a /pkg and pkgusr on build??
Guys,
Building a small app (GNU External Ballistic Calculator) for Arch. When the
PKGBUILD goes to package the file it create both
/pkg
/pkgusr
directories. It puts the .PKGINFO in /pkg and then the executable and libs under
/pkgusr -- what is up with that?? Anybody seen this before? I've grepped the
source (Makefiles, etc..) and there is no reference to "pkgusr" so what's up?
Literally, the package part creates:
00:21 nirvana:~/arch/pkg/bld/tmp> ls -l
total 268
drwxr-xr-x 2 david david 4096 May 18 00:13 pkg
drwxr-xr-x 4 david david 4096 May 18 00:13 pkgusr
drwxr-xr-x 3 david david 4096 May 18 00:03 src
-rw-r--r-- 1 david david 560 May 18 00:13 gebc-1.07-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 david david 136471 May 17 23:58 gebc-1.07-src.tar.gz
-rw-r--r-- 1 david david 107212 May 17 23:58 gebc.diff
-rw-r--r-- 1 david david 904 May 17 23:58 gebc-fl_draw.diff
-rw-r--r-- 1 david david 1393 May 17 23:57 PKGBUILD
00:21 nirvana:~/arch/pkg/bld/tmp> l pkg
total 12
drwxr-xr-x 2 david david 4096 May 18 00:13 .
drwxr-xr-x 5 david david 4096 May 18 00:13 ..
-rw-r--r-- 1 david david 573 May 18 00:13 .PKGINFO
00:21 nirvana:~/arch/pkg/bld/tmp> ls -l pkgusr
total 8
drwxr-xr-x 2 david david 4096 May 18 00:13 bin
drwxr-xr-x 2 david david 4096 May 18 00:13 lib
The resulting package gebc-1.07-1-x86_64.pkg.tar.xz doesn't contain anything but
the pkginfo file. Where do I look to figure out why this new /pkgusr dir has
popped up?
--
David C. Rankin, J.D.,P.E.
05-18-2012, 07:33 AM
Allan McRae
makepkg is creating BOTH a /pkg and pkgusr on build??
On 18/05/12 16:00, Martin Panter wrote:
> On 18 May 2012 15:26, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
>> Building a small app (GNU External Ballistic Calculator) for Arch. When the
>> PKGBUILD goes to package the file it create both
>>
>> /pkg
>> /pkgusr
>>
>> directories. It puts the .PKGINFO in /pkg and then the executable and libs under
>> /pkgusr -- what is up with that?? Anybody seen this before? I've grepped the
>> source (Makefiles, etc..) and there is no reference to "pkgusr" so what's up?
>
> Never seen it before but my guess is that somewhere the app is joining
> the $pkgdir directory with its own usr/lib/, usr/bin/ directories but
> there is no slash in between.
>
Correct... I guess using 'make DESTDIR="$pkgidr/" install' would fix it.
05-18-2012, 12:54 PM
"David C. Rankin"
makepkg is creating BOTH a /pkg and pkgusr on build??
On 05/18/2012 02:33 AM, Allan McRae wrote:
> On 18/05/12 16:00, Martin Panter wrote:
>> On 18 May 2012 15:26, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
>>> Building a small app (GNU External Ballistic Calculator) for Arch. When the
>>> PKGBUILD goes to package the file it create both
>>>
>>> /pkg
>>> /pkgusr
>>>
>>> directories. It puts the .PKGINFO in /pkg and then the executable and libs under
>>> /pkgusr -- what is up with that?? Anybody seen this before? I've grepped the
>>> source (Makefiles, etc..) and there is no reference to "pkgusr" so what's up?
>>
>> Never seen it before but my guess is that somewhere the app is joining
>> the $pkgdir directory with its own usr/lib/, usr/bin/ directories but
>> there is no slash in between.
>>
>
> Correct... I guess using 'make DESTDIR="$pkgidr/" install' would fix it.
>
>
>
>
Hmm,
OK, I'll check again for the package manipulating pkgdir, because I'm using
the standard package:
package() {
msg "Packaging ${pkgname}-${pkgver}"
cd ${pkgname}-${pkgver}
make DESTDIR=$pkgdir install
}
--
David C. Rankin, J.D.,P.E.
05-18-2012, 01:00 PM
Allan McRae
makepkg is creating BOTH a /pkg and pkgusr on build??
On 18/05/12 22:54, David C. Rankin wrote:
> On 05/18/2012 02:33 AM, Allan McRae wrote:
>> On 18/05/12 16:00, Martin Panter wrote:
>>> On 18 May 2012 15:26, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
>>>> Building a small app (GNU External Ballistic Calculator) for Arch. When the
>>>> PKGBUILD goes to package the file it create both
>>>>
>>>> /pkg
>>>> /pkgusr
>>>>
>>>> directories. It puts the .PKGINFO in /pkg and then the executable and libs under
>>>> /pkgusr -- what is up with that?? Anybody seen this before? I've grepped the
>>>> source (Makefiles, etc..) and there is no reference to "pkgusr" so what's up?
>>>
>>> Never seen it before but my guess is that somewhere the app is joining
>>> the $pkgdir directory with its own usr/lib/, usr/bin/ directories but
>>> there is no slash in between.
>>>
>>
>> Correct... I guess using 'make DESTDIR="$pkgidr/" install' would fix it.
>>
>>
>>
>>
>
>
> Hmm,
>
> OK, I'll check again for the package manipulating pkgdir, because I'm using
> the standard package:
>
> package() {
> msg "Packaging ${pkgname}-${pkgver}"
>
> cd ${pkgname}-${pkgver}
>
> make DESTDIR=$pkgdir install
^ add a "/" there....
05-18-2012, 01:04 PM
Dennis Herbrich
makepkg is creating BOTH a /pkg and pkgusr on build??
On Fri, May 18, 2012 at 07:54:27AM -0500, David C. Rankin wrote:
> OK, I'll check again for the package manipulating pkgdir, because I'm using
> the standard package:
>
> package() {
> msg "Packaging ${pkgname}-${pkgver}"
>
> cd ${pkgname}-${pkgver}
>
> make DESTDIR=$pkgdir install
> }
Interestingly enough, my /usr/share/pacman/PKGBUILD.proto thinks otherwise:
[...]
package() {
cd "$srcdir/$pkgname-$pkgver"
make DESTDIR="$pkgdir/" install
}
[...]
And besides the unquoted DESTDIR leading to trouble, the additional slash would also explain and likely fix your issue.
I'd suggest using a matching .proto file whenever creating a new package
instead of copying an old PKGBUILD. They are updated every now and then, and
you should profit from this.
Best regards.
Dennis
--
"Den Rechtsstaat macht aus, dass Unschuldige wieder frei kommen."
Dr. Wolfgang Schäuble, Bundesinnenminister (14.10.08, TAZ-Interview)
05-18-2012, 01:44 PM
"David C. Rankin"
makepkg is creating BOTH a /pkg and pkgusr on build??
On 05/18/2012 08:04 AM, Dennis Herbrich wrote:
> On Fri, May 18, 2012 at 07:54:27AM -0500, David C. Rankin wrote:
>> OK, I'll check again for the package manipulating pkgdir, because I'm using
>> the standard package:
>>
>> package() {
>> msg "Packaging ${pkgname}-${pkgver}"
>>
>> cd ${pkgname}-${pkgver}
>>
>> make DESTDIR=$pkgdir install
>> }
>
> Interestingly enough, my /usr/share/pacman/PKGBUILD.proto thinks otherwise:
> [...]
> package() {
> cd "$srcdir/$pkgname-$pkgver"
> make DESTDIR="$pkgdir/" install
> }
> [...]
>
> And besides the unquoted DESTDIR leading to trouble, the additional slash would also explain and likely fix your issue.
>
> I'd suggest using a matching .proto file whenever creating a new package
> instead of copying an old PKGBUILD. They are updated every now and then, and
> you should profit from this.
>
> Best regards.
> Dennis
>
Allan, Dennis, thanks.
I will check for a matching .proto file with new packages. I don't know if
that would have helped here. The issue was in the Makefile:
Which didn't make any difference -- that surprised me. I finally just ran a
sed script on the Makefile testing with makepkg -R and the following is what
allowed it to package properly:
find . -name "Makefile*" -exec sed -i
'/$(DESTDIR)$(bindir)/s|$(DESTDIR)$(bindir)|$(DESTDIR)/$(bindir)|g' '{}' ;
find . -name "Makefile*" -exec sed -i
'/$(DESTDIR)$(libdir)/s|$(DESTDIR)$(libdir)|$(DESTDIR)/$(libdir)|g' '{}' ;
But for some reason, placing the find/sed calls after ./configure in the
PKGBUILD didn't execute the sed calls in the same way as executing them manually
in ${srcdir}/${pkgname}-${pkgver} from within the PKGBUILD.
The PKGBUILD I attempted to use was the following:
find . -name "Makefile*" -exec sed -i
'/$(DESTDIR)$(bindir)/s|$(DESTDIR)$(bindir)|$(DESTDIR)/$(bindir)|g' '{}' ;
find . -name "Makefile*" -exec sed -i
'/$(DESTDIR)$(libdir)/s|$(DESTDIR)$(libdir)|$(DESTDIR)/$(libdir)|g' '{}' ;
make
}
package() {
msg "Packaging ${pkgname}-${pkgver}"
cd ${pkgname}-${pkgver}
make -j1 DESTDIR="${pkgdir}/" install
}
If you see anything wrong, or a better way to do something, please let me
know. If you want to take a quick look at what is going on, I've put the source
and packages on my site for your convenience [about 200k in all]:
makepkg is creating BOTH a /pkg and pkgusr on build??
On 05/18/2012 08:44 AM, David C. Rankin wrote:
> Allan, Dennis, thanks.
>
> I will check for a matching .proto file with new packages. I don't know if
> that would have helped here. The issue was in the Makefile:
>
> src/gebc-1.07/Makefile:am__installdirs = "$(DESTDIR)$(bindir)"
> src/gebc-1.07/Makefile: echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'";
> src/gebc-1.07/Makefile: $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1;
>
> I had tried both
>
> make DESTDIR=$pkgdir install
>
> and
>
> make DESTDIR="$pkgdir/" install
<snip>
Aye, yi, yi..... The "$pkgdir/" would have worked fine. (stupid moment). I was
building in a tmp folder, but the copy of the PKGBUILD I had open was in the
original gebc dir.... so the changes I made to the PKGBUILD were not made in the
tmp dir I was building in -- I hate it when that happens....
No sed calls needed and the trailing "${pkgdir}/" was all that was needed.