Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: making .deb package of NWN  (Read 2877 times)

malimbar04

  • Bay Watcher
    • View Profile
Re: making .deb package of NWN
« Reply #15 on: January 23, 2011, 10:18:39 am »

using dpkg -b with the folder as normal yields a compression from 8.6 GB to 3.8 GB.
A compression with 7z yields 2.6. GB.

Testing the theory of not all files being added to the 7z archive, I built a new one. If I simply open it with archive manager, all 8.6 GB are still there.

I tried testing it as such:
Code: [Select]
sudo 7z x -o./temp /home/nathan/NWN/nwn.7z
and now it... seems to be working. I have to go, so look forward to an edit of the results.
« Last Edit: January 23, 2011, 10:33:08 am by malimbar04 »
Logged
No! No! I will not massacre my children. Instead, I'll make them corpulent on crappy mass-produced quarry bush biscuits and questionably grown mushroom alcohol, and then send them into the military when they turn 12...

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: making .deb package of NWN
« Reply #16 on: January 23, 2011, 10:49:29 am »

using dpkg -b with the folder as normal yields a compression from 8.6 GB to 3.8 GB.
A compression with 7z yields 2.6. GB.
That's because it doesn't use lzma by default. "dpkg-deb -b -Z lzma <directory> <output>.deb" should do it.
Give me a sec, I'll stitch together a script to build the package for you.

e, Here we go, save this as buildpkg and make it an executable using "chmod 755 ./buildpkg".
Spoiler (click to show/hide)
run "./buildpkg --help". Works fine on my Ubuntu 10.04 cd.
« Last Edit: January 23, 2011, 11:49:01 am by ILikePie »
Logged

malimbar04

  • Bay Watcher
    • View Profile
Re: making .deb package of NWN
« Reply #17 on: January 24, 2011, 08:36:03 am »

The more I learn, the more obscure errors I get.
Code: [Select]
dpkg-deb -b -Z lzma <directory> <output>.deb"does indeed compress very nicely - down to 2.7 GB. I've thus made the .deb package without the postinst script, since all that does is decompress the 7z format.

However, it doesn't open.
Ubuntu Software Center says:
Internal Error
The file "/home/nathan/NWN/nwn.deb" could not be opened

Archive Manager says:
Code: [Select]
xz: (stdin): Unexpected end of input
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
dpkg-deb: subprocess tar returned error exit status 2

and
Code: [Select]
sudo dpkg -i nwn.deb works for a while, and then hits this:
Code: [Select]
(Reading database ... 170163 files and directories currently installed.)
Unpacking nwn (from nwn.deb) ...
xz: (stdin): Unexpected end of input
dpkg-deb: subprocess <decompress> returned error exit status 1
dpkg: error processing nwn.deb (--install):
 short read on buffer copy for backend dpkg-deb during `./usr/local/games/nwn/hak/cep2_core5.hak'
Errors were encountered while processing:
 nwn.deb

I'm looking into possible causes now.
Logged
No! No! I will not massacre my children. Instead, I'll make them corpulent on crappy mass-produced quarry bush biscuits and questionably grown mushroom alcohol, and then send them into the military when they turn 12...

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: making .deb package of NWN
« Reply #18 on: January 24, 2011, 08:55:06 am »

Something wrong with that package of yours. Give my script a try. run it with ./buildpkg -s <source> -d <destination> -c <control file>, where "source" is the path to the directory containing the files to be packaged, "destination" is the directory you want them installed too, and "control file" is the path to your control file.

I'm guessing it's a problem with your package tree or something. Paste the output of "ls -R /path/to/package/tree".
« Last Edit: January 24, 2011, 08:57:07 am by ILikePie »
Logged

malimbar04

  • Bay Watcher
    • View Profile
Re: making .deb package of NWN
« Reply #19 on: January 29, 2011, 11:32:00 am »

Finally got around to doing more work on the package and I tried to use your script.
The command... isn't found.
- forgot to change permissions. yes I feel silly.

The result after changing permissions:
Code: [Select]
:~/NWN$ sudo ./buildpkg -s nwn -d /temp -c nwn/DEBIAN/controlBuilding your package... cp: omitting directory `nwn/DEBIAN'
cp: omitting directory `nwn/usr'
\
Done! Created nwn.deb.
but then:
Code: [Select]
/temp# pwd
/temp
root@nathan-puget:/temp# ls
root@nathan-puget:/temp#
nothing again.
« Last Edit: January 30, 2011, 10:13:20 am by malimbar04 »
Logged
No! No! I will not massacre my children. Instead, I'll make them corpulent on crappy mass-produced quarry bush biscuits and questionably grown mushroom alcohol, and then send them into the military when they turn 12...

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: making .deb package of NWN
« Reply #20 on: January 30, 2011, 01:56:58 pm »

Looks like ./nwn contains the old package tree. The -s switch should be followed by the directory containing the game files, the one you installed the game to, eg ~/.wine/drive_c/Program Files/nwn.
e, also, Now that I think of it, I missed little switch in my script. Replace your script with this one.
Spoiler (click to show/hide)
Logged

malimbar04

  • Bay Watcher
    • View Profile
Re: making .deb package of NWN
« Reply #21 on: January 31, 2011, 10:12:57 am »

Those are the only folders that I'm working with. There is nothing in WINE or anything else. All of my sources are organized in this folder:
home/nathan/NWN

and then it's split like this:
NWN/nwn/DEBIAN
NWN/nwn/usr/local/games/nwn (working folder)

NWN/Other stuff/nwresources129 (from online)
NWN/Other stuff/nwclient129 (from online)
NWN/Other stuff/NW_DIAMOND (rip from DVD, used for expansion data)
NWN/Other stuff/English_linuxclient169_xp2 (from online, v1.69 with both expansions)
NWN/Other stuff/CEP (from online)
NWN/Other stuff/nwn_noCEP (combined without CEP, this s the working install that is copied to the working folder above)

Logged
No! No! I will not massacre my children. Instead, I'll make them corpulent on crappy mass-produced quarry bush biscuits and questionably grown mushroom alcohol, and then send them into the military when they turn 12...

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: making .deb package of NWN
« Reply #22 on: January 31, 2011, 02:14:29 pm »

Try running the script like so: "$ /buildpkg -s NWN/nwn/usr/local/games/nwn -d /tmp/nwn -c nwn/DEBIAN/control". Then install with "# dpkg -i nwn.deb" and the files currently in "NWN/nwn/usr/local/games/nwn" should show up under /tmp/nwn.
Logged

malimbar04

  • Bay Watcher
    • View Profile
Re: making .deb package of NWN
« Reply #23 on: February 01, 2011, 11:16:00 am »

I tweaked it to work, spoiler shows how.
Spoiler (click to show/hide)

Code: [Select]
sudo ./buildpkg -s NWN/nwn/usr/local/games/nwn -d /tmp/nwn -c NWN/nwn/DEBIAN/control
Building your package... |
Done! Created nwn.deb.
sudo dpkg -i nwn.deb
[sudo] password for nathan:
(Reading database ... 194515 files and directories currently installed.)
Unpacking nwn (from nwn.deb) ...
and, it's done! it worked! sort've?
/tmp/nwn shows:
Code: [Select]
data                 movies-OC.txt.dpkg-new   texturepacks
database             nwn.dpkg-new             xp1.key.dpkg-new
dialog.tlk.dpkg-new  readme-SDL.txt.dpkg-new  xp3.key.dpkg-new
EULA.txt.dpkg-new    saves
modules              servervault
/home/nathan/NWN/nwn/usr/local/games/nwn shows:
Code: [Select]
ambient     hak            nwmain                        readme-SDL.txt
chitin.key  lib            nwn                           readme.txt
data        localvault     nwn.ini                       saves
database    logs           nwnplayer.ini                 servervault
dialog.tlk  miles          NWNv169.txt                   tempclient
dmclient    modules        nwserver                      texturepacks
dmvault     movies         override                      xp1.key
docs        movies-OC.txt  Portraits                     xp2.key
EULA.txt    music          readme.linuxclientupdate.txt  xp2patch.key
fixinstall  nwm            readme.linuxserver.txt        xp3.key

it's still not copying all the files.
Logged
No! No! I will not massacre my children. Instead, I'll make them corpulent on crappy mass-produced quarry bush biscuits and questionably grown mushroom alcohol, and then send them into the military when they turn 12...

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: making .deb package of NWN
« Reply #24 on: February 01, 2011, 11:42:50 am »

That's odd, open your script again, and change 'dpkg-deb -bZ lzma temp "$OUT.deb" > /dev/null' into 'dpkg-deb -bZ lzma temp "$OUT.deb" ', and post the the script's output again. It'll give some nice and helpful error messages now.
Logged

malimbar04

  • Bay Watcher
    • View Profile
Re: making .deb package of NWN
« Reply #25 on: February 02, 2011, 12:11:41 pm »

I have to always remember to use sudo. It doesn't build if I don't.

Spoiler (click to show/hide)
and
Spoiler (click to show/hide)
Logged
No! No! I will not massacre my children. Instead, I'll make them corpulent on crappy mass-produced quarry bush biscuits and questionably grown mushroom alcohol, and then send them into the military when they turn 12...

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: making .deb package of NWN
« Reply #26 on: February 02, 2011, 12:34:36 pm »

Code: [Select]
xz: (stdin): Unexpected end of input
dpkg-deb: subprocess <decompress> returned error exit status 1
Something is wrong with the compression. I'd take this to the Ubuntu or Debian forums (Preferably Ubuntu, the chaps at Debian aren't very active.), because I have no idea how dpkg-deb works it's magic.

You can also try replacing "lzma" with "bzip2" in the script, maybe it doesn't know how to work with lzma properly. bzip2 makes larger files than lzma does though.
Logged
Pages: 1 [2]