Need help "packaging" new software for Antix

Posts: 119
wildstar84
Joined: 31 May 2014
#1
Anti, et. al.,

I forked an existing media program a while back (Audacious) and would like to make it available here for other Antix users via Synaptic/apt-get. It's currently installable only as a tarball (untar, make, sudo make install). It should be fairly easy(?) to take the existing Audacious and Audacious-plugins package debs (already in Antix) and modify them somehow to make two new packages that install this forked version. I've poked around a bit into Debian packaging and found some (confusing) info on creating packages for NEW programs, but I'm not sure the right and best way to create a new deb package from an existing one (with the same dependencies, etc.). Can someone w/experience w/making packages provide any assistance?

For the curious, the new program (Fauxdacious) adds video-capability and several other new features to the popular Audacious media player, features that the Audacious team is not currently interested in including. For more details, see:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://wildstar84.wordpress.com/2015/11/25/fauxdacious-media-player-for-linux-released/"
linktext was:"https://wildstar84.wordpress.com/2015/1 ... -released/"
====================================


Thank you in advance!
Posts: 452
Jerry
Joined: 12 Sep 2007
#2
The antiX MX packagers maintain a lengthy Wiki article that might offer some help:


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.mepiscommunity.org/wiki/system/package-building-guide"
linktext was:"http://www.mepiscommunity.org/wiki/syst ... ding-guide"
====================================
Posts: 148
figosdev
Joined: 29 Jun 2017
#3
that link no longer works, here is an archived version:


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://web.archive.org/web/20160909214303/http://www.mepiscommunity.org/wiki/system/package-building-guide"
linktext was:"https://web.archive.org/web/20160909214 ... ding-guide"
====================================



here is what appears to be its new home:


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.mxlinux.org/wiki/system/package-building-guide"
linktext was:"http://www.mxlinux.org/wiki/system/pack ... ding-guide"
====================================
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#4
Sounds like a cool project!
You might find better advice/instructions elsewhere but (as a packaging novice myself) here's the approach I would take:

Step 1:
Examine how the existing audacious is packaged for/by debian, by visiting
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://packages.debian.org/stretch/audacious"
linktext was:"https://packages.debian.org/stretch/audacious"
====================================
and download

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://http.debian.net/debian/pool/main/a/audacious/audacious_3.7.2-1.dsc"
linktext was:"http://http.debian.net/debian/pool/main ... .7.2-1.dsc"
====================================


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://http.debian.net/debian/pool/main/a/audacious/audacious_3.7.2.orig.tar.bz2"
linktext was:"http://http.debian.net/debian/pool/main ... ig.tar.bz2"
====================================


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://http.debian.net/debian/pool/main/a/audacious/audacious_3.7.2-1.debian.tar.xz"
linktext was:"http://http.debian.net/debian/pool/main ... ian.tar.xz"
====================================


Prior to packaging any software you'll need to install some prerequisite tools.
If it's not already installed on your system (from working on past projects), install the"build-essential" metapackage:
sudo apt install build-essential

edit:
after reading wildstar blog, I realize you're already up to speed regarding the"building" apsect...


Viewing the downloaded"audacious_3.7.2-1.dsc" in text editor, note that it cites the following build dependencies:
debhelper (>= 9)
dh-autoreconf
imagemagick
libdbus-1-dev (>= 0.60)
libdbus-glib-1-dev (>= 0.60)
libgtk2.0-dev
libguess-dev (>= 1.2~)
librsvg2-bin
qtbase5-dev
so, before proceeding, install any of those listed libs which aren't yet installed on your system.

Extract"audacious_3.7.2.orig.tar.bz2" into a holdingpen directory.
In the top level of this working directory, create a directory named"debian".
Extract"audacious_3.7.2-1.debian.tar.xz" and copy the extracted contents into the newly-created"debian" directory, mentioned above.
This holdingpen sourcecode tree will serve as your starting point, a frame of reference. Create an archive of its content for safekeeping.

View the"debian/control" file in text editor & verify that all the cited build dependencies are installed on your system.
(This is just a double-check. Its list should match that provided within the .dsc file)

note: If you take the time to wade through the"Debian Packaging Manual" and ancillary documentation, you'll notice
there's a"command" which automates the manual steps I've described, above.
(along the lines of: sudo apt-get install build-dep audacious)
By retreiving manually, you'll better understand what's involved/required (in case you need to mesh source code retrieved from
github or elsewhere when building a source tree for a future project)


Copy the starting-point-reference sourcecode into a working directory and test whether it successfully builds on your system.
If build fails, the error messages should (per my experience) provide clear details as to why.
From a terminal prompt, cd into your"working directory" and
dpkg-buildpackage -j9 -b -d -us -uc -tc
notes (copypasta)

Code: Select all

       The"dpkg-buildpackage" utility automates the chroot, make, and interim steps.
       Refer to its manpage to check which commandline options you might prefer (instead of those show here, above)

       Explanation of the dpkg-buildpackage commandline options, above:
            instruct how compiler many concurrent thread to use
               rule of thumb: number of CPU cores, x2 (if CPU is hyperthreading-capable), plus 1
            just binaries, skip creating deb-src
            skip checking dependencies   USE THIS ONLY AFTER FIRST SUCCESSFUL RUN
            skip signing (src+pkg)
           "tellito cleanup" deb/rules dir afterward

       NOTE:
        the dpkg-buildpackage cleanup overaggressively removes
        ./build-aux/install-sh
        SO (COMPILE FROM WITHIN A THROWAWAY WORKING DIRECTORY OR) HAVE A BACKUP

       When dpkg-buildpackage has successfully completed, in the parent of the working directory you'll the debfile it created
Last edited by skidoo on 02 Jul 2017, 18:14, edited 1 time in total.
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#5
Step 2:
(preferably on a different machine, not on the buildbox)
Test whether the .deb you've generated will successfully install & run (you should expect that it will).
Uninstall audacious, if already present on the target system, then
sudo dpkg -i /path/to/myfreshlyrolledaudacious.deb
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#6
Step 3 (and onward):

If your enhanced codebase incurs additional dependent libs, you'll need to edit the"debian/control" file and cite them therein.
You also have opportunity to cite any"Recommends" recommended packages.
You also have responsibility to cite therein, any"Provides:" or"Conflicts:" (but idunno any that apply to the case of audacious)

Now you're ready to begin overwriting the audacious sourcetree files with your modded copies of files, inserting new files, etc.

At some point, you will probably want/need to refer to the debian packaging documentation, in order to find answers to details like
"How to instruct /path/path/myfile should wind up as /usr/share/myDacious/myfile on the installed system?"

By examining the content of the various files pathed under /debian/ in the working directory, you'll find out which, if any, of the"upstream"
make / automake mechanisms are (in the"reference/startingpoint" package) ignored by, or overridden by, the debian buildscripts.
Also, you'll likely want to tweak, and extend, the directives provided within (e.g."postinst") the various debian-specific files.

When you are ready to"test build", copy your sourcetree to a clean directory, cd into the directory and dpkg-buildpackage -j9 -b -d -us -uc -tc

As for"test install" and"test run", the particulars probably vary, depending on the project.
You might (or might not) need to UNinstall the existing package from the target system each time, prior to
sudo dpkg -i /path/to/mydebfile.deb
If you don't uninstall beforehand, you might (or might not) need to command: sudo dpkg -i --force
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#7
Image

I didn't notice ~~ did you intend plugins to be installed with, bundled into, the package... or users optionally install 'em ad hoc, individually?
If the former, and each of the laundrylist libs isn't stated as"Depends", how do you intend to handle oopsies?
Each plugin checks at runtime, and conditionally raises a dialogbox"To use this plugin, you need to install libsuchandsuch" ?

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://wildstar84.wordpress.com/2015/11/25/fauxdacious-media-player-for-linux-released/"
linktext was:"https://wildstar84.wordpress.com/2015/1 ... -released/"
====================================


If you already have a fairly up-to-date version of Audacious running, you probably already have the dependencies installed. If not, here’s a list. Note, most of these aren’t required to actually get Fauxdacious (or Audacious) to run, but many are needed for particular plugins in order to process different types of media.
Depends: libasound2
Depends: libatk1.0-0
Depends: libaudcore3
Depends: libavcodec56
Depends: libavformat56
Depends: libavutil54
Depends: libbs2b0
Depends: libc6
Depends: libcairo2
Depends: libcddb2
Depends: libcdio-cdda1
Depends: libcdio13
Depends: libcue1
Depends: libcurl3-gnutls
Depends: libdbus-1-3
Depends: libdbus-glib-1-2
Depends: libfaad2
Depends: libflac8
Depends: libfluidsynth1
Depends: libfontconfig1
Depends: libfreetype6
Depends: libgcc1
Depends: libgdk-pixbuf2.0-0
Depends: libgl1-mesa-glx
Depends: libgl1-mesa-glx
Depends: libglib2.0-0
Depends: libgtk2.0-0
Depends: libjack-jackd2-0
Depends: libjack-jackd2-0 libjack0
Depends: liblircclient0
Depends: libmms0
Depends: libmodplug1
Depends: libmp3lame0
Depends: libmpg123-0
Depends: libneon27-gnutls
Depends: libnotify4
Depends: libogg0
Depends: libpango-1.0-0
Depends: libpangocairo-1.0-0
Depends: libpangoft2-1.0-0
Depends: libpulse0
Depends: libsamplerate0
Depends: libsdl2-2.0-0
Depends: libsidplayfp4
Depends: libsndfile1
Depends: libsndio6.0
Depends: libsoxr0
Depends: libstdc++6
Depends: libvorbis0a
Depends: libvorbisenc2
Depends: libvorbisfile3
Depends: libwavpack1
Depends: libx11-6
Depends: libxcomposite1
Depends: libxml2
Depends: libxrender1
Depends: libdvdread
Depends: libdvdnav
Depends: zlib1g
Posts: 148
figosdev
Joined: 29 Jun 2017
#8
i hate to point out that while i updated a year old link, its difficult to say whether audacious is still being packaged or not. sorry for the necro; less sorry for finding the archived link and new url.
Posts: 119
wildstar84
Joined: 31 May 2014
#9
The Audacious way is to bundle all the supported plugins into a single separate package (audacious-plugins). They actually do 3 packages (audacious, audacious-plugins, and libaudcore) I started to create my versions of each of these, but after getting into it a bit, it looks to me like it'd be simpler to just create one giant package that will"replace" these three.

Yes, Audacious is also still in active development (and keeping me busy merging from their GIT, but they haven't released a new packaged production version since January of this year.

I've let this sit on the back burner for a few months as I've been very actively developing on Fauxdacious until just recently (with v3.83-final just released), but I plan to pick this ball back up again very soon, so thanks for the recent and very useful replies!

Jim
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#10
keep attention to items listed for the audacity-plugins
PreDepends:
Breaks:
Replaces:

FWIW, I would be nervous about the implications (potential for frequently-changing"foundation of sand") if bundled into a single package.
Posts: 119
wildstar84
Joined: 31 May 2014
#11
Not quite sure I'm following you. Audacious-plugins is only used by Audacious, it is in no way related to Audacity!
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#12
Audacious-plugins is only used by Audacious, it is in no way related to Audacity!
oops, I looked up the wrong package. Sorry for the mixup.
Posts: 119
wildstar84
Joined: 31 May 2014
#13
Ok, I've finally built a binary package for Stretch. The source is available from tarballs though. Please feel free to test out! It is available here at:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://phoenixcomm.net/~jturner/fauxdacious_3.83-final_i386.deb"
linktext was:"http://phoenixcomm.net/~jturner/fauxdac ... l_i386.deb"
====================================


What do I need to do to get it into contrib?

Thanks,

Jim