Page 4 of 4 FirstFirst ... 234
Results 31 to 38 of 38

Thread: HOW TO package arbitrary files for your PPA

  1. #31
    Join Date
    Jul 2006
    Location
    Hertfordshire
    Beans
    454
    Distro
    Kubuntu 9.04 Jaunty Jackalope

    Re: HOW TO package arbitrary files for your PPA

    Quote Originally Posted by _sluimers_ View Post
    I get an error when I try debuild -k<key> -S -sa:
    Code:
    make: *** No rule to make target `clean'.  Stop.
    dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit status 2
    debuild: fatal error at line 1334:
    dpkg-buildpackage -rfakeroot -d -us -uc -S -sa failed
    scons: *** [test] Error 29
    As the error suggests, you don't have a "clean" target in your Makefile. dpkg-buildpackage needs this so that your package can delete the helloworld.py if the user decides to remove the package later on.

    If you read the first post carefully, you'll notice this line near the top of the example rules file:

    include /usr/share/cdbs/1/rules/debhelper.mk
    This line includes a lot of debhelper targets, including the missing "clean" one. Hopefully adding this line will resolve the issue you're seeing.

  2. #32
    Join Date
    Apr 2007
    Beans
    199
    Distro
    Ubuntu

    Re: HOW TO package arbitrary files for your PPA

    Ah, I see a makefile and a "clean:" line in it are absolutely necessary. I have it working now however, when I try to upload a small multi-platform RPG maker (which I didn't help develop, but have been part of the community for a long long time) on my ppa I encountered some problems:

    * Permission. I can't run the program without using sudo.. well the program DOES run, but gives off errors whenever I want to add delete a sprite/map/game file.

    * The excutable doesn't work as I do not know how to use the makefile in order to run and install python files. Below is what's in the iked.py right now (it should simply another iked.py file)
    Code:
    print "python /usr/share/ika/iked/iked.py"
    * the menu icon shows up in 'Others' and not in 'Games'

    * ln -s $(SHAREDIR)/iked.png $(PIXMAPSDIR)/iked.png makes the link go to debian/ika/usr/share/ika/ika.png and not /usr/share/ika/ika.png

    ika.menu
    Code:
    ?package(iked):needs="ika" section="Games/Board"\
      icon="iked.png"\
      title="Iked" command="python /usr/share/iked/iked.py"
    makefile
    Code:
    MDIR = iked/app
    LDIR = linux
    
    PREFIX=debian/iked/usr
    BINDIR=$(PREFIX)/games
    SHAREDIR=$(PREFIX)/share/ika
    MENUDIR=$(PREFIX)/share/menu
    APPDIR=$(PREFIX)/share/applications
    PIXMAPSDIR=$(PREFIX)/share/pixmaps
    IKEDDIR=$(SHAREDIR)/iked
    
    .PHONY : clean install iked
    
    iked: iked.py	
    	python iked.py > $(LDIR)/iked
    
    install: $(LDIR)/iked	
    	mkdir -p $(BINDIR)  
    	mkdir -p $(SHAREDIR)
    	mkdir -p $(IKEDDIR)
    	mkdir -p $(PIXMAPSDIR)
    	mkdir -p $(MENUDIR)
    	mkdir -p $(APPDIR)
    	install $(LDIR)/iked $(BINDIR)/iked
    	cp -rf $(MDIR)/* $(IKEDDIR)
    	cp $(LDIR)/iked.png $(SHAREDIR)/iked.png
    	cp $(LDIR)/iked.menu $(MENUDIR)/iked
    	cp $(LDIR)/iked.desktop $(APPDIR)/iked.desktop
    	ln -s $(SHAREDIR)/iked.png $(PIXMAPSDIR)/iked.png
    
    clean:
    	rm -f $(LDIR)/iked

  3. #33
    Join Date
    Jul 2006
    Location
    Hertfordshire
    Beans
    454
    Distro
    Kubuntu 9.04 Jaunty Jackalope

    Re: HOW TO package arbitrary files for your PPA

    Quote Originally Posted by _sluimers_ View Post
    * Permission. I can't run the program without using sudo.. well the program DOES run, but gives off errors whenever I want to add delete a sprite/map/game file.
    If the program runs (without using sudo), then it sounds like the package is installing the software correctly, but not configuring it properly afterwards.

    What you need to do is ensure these sprite, map and game files are not stored in /usr/share/ika/ - as a normal user does not have permission to add/remove files from that directory.

    You need to specify a folder in the user's home directory for storing game data, something like "/home/user/.local/share/ika/". You may need to speak to the developers on how to do this, usually it's a matter of setting a variable in a config file.

    * The excutable doesn't work as I do not know how to use the makefile in order to run and install python files. Below is what's in the iked.py right now (it should simply another iked.py file)
    Code:
    print "python /usr/share/ika/iked/iked.py"
    Well I'm not entirely sure what you want, but if you are simply making a wrapper in /usr/bin/ that calls the "iked.py" program, you could just make a shell script, call it something like "iked" (without the .py):

    Code:
    #!/bin/sh
    exec python /usr/share/ika/iked/iked.py "$@"
    Alternatively, you could just make a symlink to iked.py in /usr/bin, like you did for your icon...

    * the menu icon shows up in 'Others' and not in 'Games'
    Sorry, I'm not sure about this one as I haven't used the .menu approach that you have. I usually hand-craft my .desktop file and drop it in place directly from the Makefile. If you could post the .desktop file that is created I might be able to see what's wrong.

    * ln -s $(SHAREDIR)/iked.png $(PIXMAPSDIR)/iked.png makes the link go to debian/ika/usr/share/ika/ika.png and not /usr/share/ika/ika.png
    Your symlink is created before all the files are moved into place by dpkg, which means after installation it is pointing to the wrong directory.

    There are a number of ways around this, but the simplest is to use a relative path for the symlink target:

    Code:
    ln -s ../ika/iked.png $(PIXMAPSDIR)/iked.png

  4. #34
    Join Date
    Apr 2007
    Beans
    199
    Distro
    Ubuntu

    Re: HOW TO package arbitrary files for your PPA

    Thank you so much! Everything works almost perfectly now, including the desktop icon I (g)edited . I mistakenly thought the /usr/share/menu folder was for this kind of stuff.

    One last problem has to do with permissions. When I try to close the app I get this error message:

    Code:
    Traceback (most recent call last):
      File "/usr/share/ika/iked/_iked/ui.py", line 405, in OnClose
        self.app.config.save()
      File "/usr/share/ika/iked/_iked/config.py", line 64, in save
        f = open(self.path, 'w')
    IOError: [Errno 13] Permission denied: '/usr/share/ika/iked/config.ini'
    Do I need to chmod these files in my makefile or ask the developer to change his code?
    Last edited by _sluimers_; February 4th, 2010 at 11:44 AM.

  5. #35
    Join Date
    Jul 2006
    Location
    Hertfordshire
    Beans
    454
    Distro
    Kubuntu 9.04 Jaunty Jackalope

    Re: HOW TO package arbitrary files for your PPA

    Quote Originally Posted by _sluimers_ View Post
    Thank you so much! Everything works almost perfectly now, including the desktop icon I (g)edited . I mistakenly thought the /usr/share/menu folder was for this kind of stuff.
    Excellent.

    One last problem has to do with permissions. When I try to close the app I get this error message:

    Code:
    Traceback (most recent call last):
      File "/usr/share/ika/iked/_iked/ui.py", line 405, in OnClose
        self.app.config.save()
      File "/usr/share/ika/iked/_iked/config.py", line 64, in save
        f = open(self.path, 'w')
    IOError: [Errno 13] Permission denied: '/usr/share/ika/iked/config.ini'
    Do I need to chmod these files in my makefile or ask the developer to change his code?
    You definitely don't want to chmod the file, it is being installed as a system file so is deliberately read-only. Otherwise, if one user saves to the file it will overwrite any config settings made by another user on the machine.

    What you need is for the config.ini to be read from the user's home directory instead of the system one. If no config file is available (e.g. the engine is run for the first time by a user), then the system config.ini should be copied into that user's home directory.

    This may require a code change, if you ask the developer then he might have some thoughts on this. It sounds like the rest of the package is in pretty good shape though.

  6. #36
    Join Date
    Apr 2007
    Beans
    199
    Distro
    Ubuntu

    Re: HOW TO package arbitrary files for your PPA

    Okay, everything works now .
    Last edited by _sluimers_; February 4th, 2010 at 05:55 PM.

  7. #37
    Join Date
    Oct 2012
    Location
    Classified
    Beans
    49
    Distro
    Ubuntu 12.04 Precise Pangolin

    Post Re: HOW TO package arbitrary files for your PPA

    Hey, I need help. I got an error, but I can't find my problem.
    Code:
    james@james-OptiPlex-GX620:~/PPA/helloworld/helloworld-1.0$ debuild -S
    parsechangelog/debian: warning:     debian/changelog(l5): found eof where expected more change data or trailer
     dpkg-buildpackage -rfakeroot -d -us -uc -S
    dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
    dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): -D_FORTIFY_SOURCE=2
    dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
    dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2
    dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): -Wl,-Bsymbolic-functions -Wl,-z,relro
    parsechangelog/debian: warning:     debian/changelog(l5): found eof where expected more change data or trailer
    dpkg-buildpackage: error: unable to determine source changed by
    dpkg-buildpackage: source package helloworld
    dpkg-buildpackage: source version 1.0-0ubuntu1~ppa1
    debuild: fatal error at line 1350:
    dpkg-buildpackage -rfakeroot -d -us -uc -S failed
    james@james-OptiPlex-GX620:~/PPA/helloworld/helloworld-1.0$
    I probably made some ridiculously stupid/obvious mistake, but I can't figure out what. Could you please give this a look?

    NOTE: tried sudo debuild -S, but got the same results.

  8. #38
    Join Date
    Oct 2012
    Location
    Classified
    Beans
    49
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOW TO package arbitrary files for your PPA

    Okay, I tried starting over with a clean slate; just restarting the whole process. It says that the file /usr/share/cdbs/1/rules/debhelper.mk does not exist. What do I need to do? I checked /usr/share/, but there is no file or folder labeled cdbs or anything similar. What do I need to do?
    Last edited by JamesTheAwesomeDude; November 12th, 2012 at 04:16 AM.

Page 4 of 4 FirstFirst ... 234

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •