Author Topic: What Do You Do If There's No Destdir Option?  (Read 10807 times)

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
What Do You Do If There's No Destdir Option?
« on: May 05, 2007, 11:04:53 pm »
How do you package an app up if "grep DESTDIR Makefile" returns nothing?
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

danr

  • Full Member
  • ***
  • Posts: 138
    • View Profile
    • http://
What Do You Do If There's No Destdir Option?
« Reply #1 on: May 06, 2007, 03:25:07 am »
Quote
How do you package an app up if "grep DESTDIR Makefile" returns nothing?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160566\"][{POST_SNAPBACK}][/a][/div]
You could search the Makefile for 'prefix' or '/usr', and change to $PWD/ipkg/usr or something similar.
SL-C860 running Debian EABI on top of Angstrom 2.6 kernel

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
What Do You Do If There's No Destdir Option?
« Reply #2 on: May 06, 2007, 10:50:33 am »
Quote
Quote
How do you package an app up if "grep DESTDIR Makefile" returns nothing?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160566\"][{POST_SNAPBACK}][/a][/div]
You could search the Makefile for 'prefix' or '/usr', and change to $PWD/ipkg/usr or something similar.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160574\"][{POST_SNAPBACK}][/a][/div]
Doesn't that lead to issues apon installation on the ipk?
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
What Do You Do If There's No Destdir Option?
« Reply #3 on: May 06, 2007, 11:09:42 am »
Quote
How do you package an app up if "grep DESTDIR Makefile" returns nothing?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160566\"][{POST_SNAPBACK}][/a][/div]

some have INSTALL_ROOT instead of DESTDIR. maybe you're in luck...
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
What Do You Do If There's No Destdir Option?
« Reply #4 on: May 06, 2007, 11:16:24 am »
Nope.  
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

danr

  • Full Member
  • ***
  • Posts: 138
    • View Profile
    • http://
What Do You Do If There's No Destdir Option?
« Reply #5 on: May 06, 2007, 01:03:13 pm »
Quote
Quote
Quote
How do you package an app up if "grep DESTDIR Makefile" returns nothing?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160566\"][{POST_SNAPBACK}][/a][/div]
You could search the Makefile for 'prefix' or '/usr', and change to $PWD/ipkg/usr or something similar.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160574\"][{POST_SNAPBACK}][/a][/div]
Doesn't that lead to issues apon installation on the ipk?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160604\"][{POST_SNAPBACK}][/a][/div]

It might do - you could give it a go.  Otherwise,  you might be able to do a make install -n > script.sh, and replace all instances of /usr with $PWD/ipkg/usr in script.sh, then execute the script.
SL-C860 running Debian EABI on top of Angstrom 2.6 kernel

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
What Do You Do If There's No Destdir Option?
« Reply #6 on: May 06, 2007, 01:51:22 pm »
Quote
Quote
Quote
Quote
How do you package an app up if "grep DESTDIR Makefile" returns nothing?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160566\"][{POST_SNAPBACK}][/a][/div]
You could search the Makefile for 'prefix' or '/usr', and change to $PWD/ipkg/usr or something similar.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160574\"][{POST_SNAPBACK}][/a][/div]
Doesn't that lead to issues apon installation on the ipk?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160604\"][{POST_SNAPBACK}][/a][/div]

It might do - you could give it a go.  Otherwise,  you might be able to do a make install -n > script.sh, and replace all instances of /usr with $PWD/ipkg/usr in script.sh, then execute the script.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160615\"][{POST_SNAPBACK}][/a][/div]
The script method doesn't seem to work, so I'm going to give the Makefile method a try. Do I need to edit all of the makefiles, or just one? Is there a good way to group edit the makefiles?

Thanks.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
What Do You Do If There's No Destdir Option?
« Reply #7 on: May 06, 2007, 07:08:07 pm »
Quote
Quote
You could search the Makefile for 'prefix' or '/usr', and change to $PWD/ipkg/usr or something similar.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160574\"][{POST_SNAPBACK}][/a][/div]
Doesn't that lead to issues apon installation on the ipk?
I think if you add the $PWD after have you done "make" and just before you do "make install" it should be OK? Otherwise find the "install" section of the Makefile and add DESTDIR manually. Eg here's one for zlib:

Code: [Select]
install: $(LIBS)
        -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
        -@if [ ! -d $(DESTDIR)$(includedir)  ]; then mkdir -p $(DESTDIR)$(includedir); fi
        -@if [ ! -d $(DESTDIR)$(libdir)      ]; then mkdir -p $(DESTDIR)$(libdir); fi
        -@if [ ! -d $(DESTDIR)$(man3dir)     ]; then mkdir -p $(DESTDIR)$(man3dir); fi
        cp zlib.h zconf.h $(DESTDIR)$(includedir)
        chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
        cp $(LIBS) $(DESTDIR)$(libdir)
        cd $(DESTDIR)$(libdir); chmod 755 $(LIBS)
        -@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
        cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \
          rm -f $(SHAREDLIB) $(SHAREDLIBM); \
          ln -s $(SHAREDLIBV) $(SHAREDLIB); \
          ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
          (ldconfig || true)  >/dev/null 2>&1; \
        fi
        cp zlib.3 $(DESTDIR)$(man3dir)
        chmod 644 $(DESTDIR)$(man3dir)/zlib.3
Quote
Do I need to edit all of the makefiles
Normally you should only need to edit main Makefile, the ones in subdirectories usually defer "install" to that main Makefile. In fact I don't recall any application that required editing makefiles in the subdirectories.
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
What Do You Do If There's No Destdir Option?
« Reply #8 on: May 06, 2007, 07:23:32 pm »
Sorry if I'm being thick, but I don't see where to add stuff into this (apparently very abnormal) Makefile.

Code: [Select]
# "$Id: Makefile 1526 2005-02-03 15:11:44Z karijes $"
#
# Top-level makefile for the Fast Light Tool Kit (FLTK).
#
# Copyright 1998-1999 by Bill Spitzak and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
#
# Please report all bugs and problems to "fltk-bugs@easysw.com".
#

SHELL=/bin/sh
OS_NAME := $(shell uname -s | sed "s/\//-/" | sed "s/_/-/" | sed "s/-.*//g")

DIRS = src tools themes efltk locale test

GENERATED = makeinclude efltk-config

all: $(GENERATED)
    @for dir in $(DIRS); do\
  if test ! -f $$dir/makedepend; then\
      touch $$dir/makedepend;\
  fi;\
  (cd $$dir; $(MAKE) $(MFLAGS)) || exit;\
    done

static: $(GENERATED)
    @for dir in $(DIRS); do\
  if test ! -f $$dir/makedepend; then\
      touch $$dir/makedepend;\
  fi;\
  (cd $$dir; $(MAKE) $(MFLAGS) static) || exit;\
    done

shared: $(GENERATED)
    @for dir in $(DIRS); do\
  if test ! -f $$dir/makedepend; then\
      touch $$dir/makedepend;\
  fi;\
  (cd $$dir; $(MAKE) $(MFLAGS) shared) || exit;\
    done

install: $(GENERATED)
    @for dir in $(DIRS); do\
  if test ! -f $$dir/makedepend; then\
      touch $$dir/makedepend;\
  fi;\
  (cd $$dir; $(MAKE) $(MFLAGS) install) || exit;\
    done

install_static: $(GENERATED)
    @for dir in $(DIRS); do\
  if test ! -f $$dir/makedepend; then\
      touch $$dir/makedepend;\
  fi;\
  (cd $$dir; $(MAKE) $(MFLAGS) install_static) || exit;\
    done

install_shared: $(GENERATED)
    @for dir in $(DIRS); do\
  if test ! -f $$dir/makedepend; then\
      touch $$dir/makedepend;\
  fi;\
  (cd $$dir; $(MAKE) $(MFLAGS) install_shared) || exit;\
    done

install_programs: $(GENERATED)
    @for dir in $(DIRS); do\
  if test ! -f $$dir/makedepend; then\
      touch $$dir/makedepend;\
  fi;\
  (cd $$dir; $(MAKE) $(MFLAGS) install_programs) || exit;\
    done

depend: $(GENERATED)
    @for dir in $(DIRS); do\
  if test ! -f $$dir/makedepend; then\
      touch $$dir/makedepend;\
  fi;\
  (cd $$dir;$(MAKE) $(MFLAGS) depend) || exit;\
    done

uninstall: $(GENERATED)
    @for dir in $(DIRS); do\
  (cd $$dir;$(MAKE) $(MFLAGS) uninstall) || exit;\
    done

clean:
    -@ rm -f core *~ *.o *.bck
    @for dir in $(DIRS); do\
  (cd $$dir;$(MAKE) $(MFLAGS) clean) || exit;\
    done

distclean: clean
    rm -f *~ config.* makeinclude efltk-config

ifeq ($(OS_NAME), MINGW32)

configure:

$(GENERATED):

else

$(GENERATED): configure makeinclude.in configh.in efltk-config.in
    ./configure

configure: configure.in
    autoconf
    
endif

portable-dist:
    epm -v efltk

native-dist:
    epm -v -f native efltk

#
# End of "$Id: Makefile 1526 2005-02-03 15:11:44Z karijes $".
#
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
What Do You Do If There's No Destdir Option?
« Reply #9 on: May 07, 2007, 02:25:47 am »
Quote
Sorry if I'm being thick, but I don't see where to add stuff into this (apparently very abnormal) Makefile.
I downloaded efltk (which is where I presume you got this mess from ) and did
Code: [Select]
./configure --prefix=/usr/local/Checking the Makefile(s) in the various directories, it seems that the bit which really does the installing is contained in ./src/makeinclude_tmpl, so I would suggest editing that file.
Disclaimer: I'm no expert so use your own judgement
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
What Do You Do If There's No Destdir Option?
« Reply #10 on: May 07, 2007, 07:42:21 am »
I'm going to need to install it anyway, so no worries about having it installed.

And yes, that is from efltk.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
What Do You Do If There's No Destdir Option?
« Reply #11 on: May 07, 2007, 08:55:56 am »
What I do, when faced with a prog that doesn't use DESTDIR is: install it in emacs, you can then save the buffer as text file for future reference. Then page through the install buffer in emacs and just copy the files manually from their installed location into a dir preserving the dir structure. Then you can create the ipk. Tedious, yeah, but works...
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
What Do You Do If There's No Destdir Option?
« Reply #12 on: May 07, 2007, 09:04:04 am »
Quote
What I do, when faced with a prog that doesn't use DESTDIR is: install it in emacs, you can then save the buffer as text file for future reference. Then page through the install buffer in emacs and just copy the files manually from their installed location into a dir preserving the dir structure. Then you can create the ipk. Tedious, yeah, but works...
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160702\"][{POST_SNAPBACK}][/a][/div]

why emacs? just use script or redirect the output of the make install into a file...

oh and dont forget to send the author a note telling him/her that they should add DESTDIR
« Last Edit: May 07, 2007, 09:05:11 am by Meanie »
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
What Do You Do If There's No Destdir Option?
« Reply #13 on: May 07, 2007, 09:17:47 am »
Well, I use emacs for most stuff, so I'm always in it... And then, you don't need no script.
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
What Do You Do If There's No Destdir Option?
« Reply #14 on: May 07, 2007, 02:08:31 pm »
Quote
oh and dont forget to send the author a note telling him/her that they should add DESTDIR
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160703\"][{POST_SNAPBACK}][/a][/div]
I will do that.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo