Kara-Moon Forum

Developers & Technology => Musical MIDI Accompaniment (MMA) => Topic started by: bvdp on April 28, 2008, 11:06:58 PM



Title: DEB package, please test
Post by: bvdp on April 28, 2008, 11:06:58 PM

I have created a .deb file for MMA which includes all the docs (html and pdf), the libaries, etc. This is my first .deb, so please be kind :)

This .deb file is just under 2meg in size.

Before I put the link up on the web site could a few you please download it and try an install. I'd like to have some confirmation that it works before releasing this to the masses. The file is at:

   http://mellowood.ca/mma/mma_1.3b_all.deb

After downloading you should be able to do:

    sudo dpkg -i mma_1.3b_all.deb

and get it all installed.

BTW, the install is done to /usr/share/doc and /usr/share/mma which is where I think debian think stuff like this should go. If I'm wrong, again let me know. My intent on this is to have the .deb available as an alternate file for users who what things to go a bit easier. I will continue the other distributions.

Thanks!!!!




Title: Re: DEB package, please test
Post by: folderol on April 28, 2008, 11:30:56 PM
I'll try to have a look at this tomorrow... Oh it is tomorrow  :P


Title: Re: DEB package, please test
Post by: bvdp on April 29, 2008, 12:26:45 AM
Is not. It is still today here :)

When you get a chance, please do and let me know.

Don't let this stop others from trying as well. The more reports of what I did wrong, the better  ;)


Title: Re: DEB package, please test
Post by: kara on April 29, 2008, 08:18:53 AM
ok, i have a first  remark  :-\

Your MMA deb package depends on python 2.5.
The 'official' debian python version is still 2.4.4, so this gives dependency problems and makes it impossible to install.
As far as I  could find, the 2.5 release isn't in the debian'edge' repository yet. I agree you could install it directly from the python site, but then you'll have to compile it yourself... which isn't open for all users  ;D

It would be a better idea to change the deb package with dependencies to python 2.4.4

k
 


Title: Re: DEB package, please test
Post by: bvdp on April 29, 2008, 04:15:40 PM
Thanks for the python pointer. My own docs say that we need 2.4 and that is what mma checks for when it starts up. I was thinking myself very clever in doing "python --version" to find the version number to use. For some reason, I have 2.5.1 on my system. I don't think I've compiled it myself, but who knows.

Anyway, I have changed the dep to (>=2.4.0) which should match everything else. The version on the site reflects the change.



Title: Re: DEB package, please test
Post by: folderol on April 29, 2008, 09:35:30 PM
That would have been a show stopper for me to (using 64Studio which is based on debian etch), but I'm afraid i haven't had time yet.

I will make a determined effort tomorrow!


Title: Re: DEB package, please test
Post by: kara on April 30, 2008, 07:45:14 AM
ok Bob, one step forward but not quit there yet.

1. Small detail : the new package has a (2) in the name, dpkg doesn't accept this in the name, you'll have to rename this.
2. Installation works now but...
- It creates the needed directory structures and copies the files in it
So we have in /usr/share/ :
         /mma
               - eggs
               - MMA
               - inlcudes
               - libs
               - text
               - utils
and all directories contains the right files.
BUT : the main /mma directory doesn't contains the main files, which should be
                - mma.py
                - mklibdoc.py
                - pg2mma.py
those are missing, i suppose that you forgot those in the deb ?

Documentation is installed ok, pdf & html works and the links in the html help files are ok.

I hope this helps.



Title: Re: DEB package, please test
Post by: bvdp on April 30, 2008, 04:48:52 PM
ok Bob, one step forward but not quit there yet.

1. Small detail : the new package has a (2) in the name, dpkg doesn't accept this in the name, you'll have to rename this.


Uhhh??? I just scratched my head and tried to figure this out. The package is mma_1.3b_all.deb ... oh, I  bet you did a 2nd download and your browser created a 2nd file with the (2). Before downloading delete the first one :)

Quote

2. Installation works now but...
and all directories contains the right files.
BUT : the main /mma directory doesn't contains the main files, which should be
                - mma.py
                - mklibdoc.py
                - pg2mma.py
those are missing, i suppose that you forgot those in the deb ?


No, this is correct. The main module mma.py is only needed on installs which link to this. In the deb install mma.py is copied to /usr/local/bin/ as "mma". You are probably running into problems with a old manual install which has somedir/bin/mma set up as a link. ???

The programs mklibdoc and pg2mma are installed in /usr/share/mma/utils. Maybe they should go to /usr/local/bin as well? Comments on this?


I have noticed one other "problem" with the install. If I install the .deb I do so as root using sudo. The first time I run mma (as user bob) it creates the .pyc files and all is wonderful. However, if my first run is as a different user (say I have an account for user val) the .pyc files are NOT created. I assume this is since "val" doesn't have permission to write to /usr/share/mma. Python is good this way and lets you run the .py files, put I'm wondering if there is a better solution. Maybe I should pack the .pyc files into the .deb as well?



Title: Re: DEB package, please test
Post by: kara on April 30, 2008, 05:37:33 PM


Uhhh??? I just scratched my head and tried to figure this out. The package is mma_1.3b_all.deb ... oh, I  bet you did a 2nd download and your browser created a 2nd file with the (2). Before downloading delete the first one :)


right, this was my fault, sorry

Quote

No, this is correct. The main module mma.py is only needed on installs which link to this. In the deb install mma.py is copied to /usr/local/bin/ as "mma". You are probably running into problems with a old manual install which has somedir/bin/mma set up as a link. ???

The programs mklibdoc and pg2mma are installed in /usr/share/mma/utils. Maybe they should go to /usr/local/bin as well? Comments on this?


I have noticed one other "problem" with the install. If I install the .deb I do so as root using sudo. The first time I run mma (as user bob) it creates the .pyc files and all is wonderful. However, if my first run is as a different user (say I have an account for user val) the .pyc files are NOT created. I assume this is since "val" doesn't have permission to write to /usr/share/mma. Python is good this way and lets you run the .py files, put I'm wondering if there is a better solution. Maybe I should pack the .pyc files into the .deb as well?



Wrong, mma.py isn't there. Have a look at your deb package, it's not in the package...
as for the *.pyc files...
on a 'clean' linux system, users shouldn't have write access to /usr/share, so your 'bob' user shouldn't have write access to this ;D
So yes, the logical solution will be to include the pyc files in the distribution (or write in the installation manual that the first time you have to run mma as root, but this isn't very clean :D ).
And yes in my opinion the other 2 programs should go in /usr/local/bin together with mma.py

k


Title: Re: DEB package, please test
Post by: folderol on April 30, 2008, 07:26:40 PM
Still haven't had time to get to work with this myself :(

Once installed, no application should ever have to be run as root unless it is a system utility, so yes it would be best to include the .pyc files.

The other alternative is to not install it at all, but run it in userspace in the /home/{user} directory.

The ROX desktop does this with applications neatly packaged in their own directory.

Firefox also does something similar.


Title: Re: DEB package, please test
Post by: bvdp on April 30, 2008, 08:09:01 PM

Once installed, no application should ever have to be run as root unless it is a system utility, so yes it would be best to include the .pyc files.


Solved and yet updated again on the site. Sorry, if this is confusing since I keep using the same filename :) But, the current filesize is 1918244.

Anyway, the .deb now contains a postinst file which is run after the files are installed. It does (as root) a "/usr/local/bin/mma -G" which forces the update of the database and creates the pyc files. I ran it here and it appears to work. Hopefully some others can confirm.

Thanks.


Title: Re: DEB package, please test
Post by: folderol on April 30, 2008, 08:50:37 PM
OK seems to work fine with 64studio V 2.0

I did a quick check with a couple of your example files from the website and MMA produces MIDI files that Rosegarden is quite happy to import and play without problems.

It's a interesting app. I'll have more of a play when I have time (oh har-de-har 'more time' ho-ho-ho).


Title: Re: DEB package, please test
Post by: kara on April 30, 2008, 08:56:53 PM
Confirmation here Bob, all works fine now.
Everything in the right place, post install script runs fine and all pyc files are there  8)

Top job !

k

Now you'll have to update the central debian edge repository, that way synaptic will do an automatic update  :D

 


Title: Re: DEB package, please test
Post by: bvdp on May 01, 2008, 01:35:06 AM

Glad to see that all the %*&#* around I did this AM is paying off. The program lintian (which checks debian packages) still flags some stuff as "wrong", but I can't figure a lot of this stuff out. But, if it works for us folks who haven't joined the debian-cult, that's fine with me.

I will see if I can make contact with the studio64 folks and to get a new mma included.

One more question. I see most/all debian stuff installs in /usr/bin so I'm going to make that change unless there is an objection. I'm not making any changes to the normal distro, so if you download and install the tar.gz it'll still go into /usr/local/bin.


Title: Re: DEB package, please test
Post by: folderol on May 01, 2008, 06:19:18 PM
I could be wrong, but my understanding is the by convention all distro stuff goes in /usr/{whatever} but all user installed bits go in /usr/local/{whatever} or if it's relocatable/ run from the spot, userspace.


Title: Re: DEB package, please test
Post by: bvdp on May 01, 2008, 11:50:44 PM
I think you are correct. But, here's the rub :) If you run lintian against a deb with stuff NOT going into /usr it rises all kinds of flags. So, I have to assume that this means that ALL deb stuff goes into /usr.

I agree that my program should go into /usr/local ... but I don't want to upset the debian folks.

However, one thing is clear: if parts go into /usr then all should go there. It is probably wrong to put the data files in /usr/share and the binaries into /usr/local.

I have yet to see anything installed by distos in userland. Apart from config files.

So, I think I'll leave everything in the .deb in /usr. If folks don't like that, dl the tarball and install where you want it.


Title: Re: DEB package, please test
Post by: wvengen on October 01, 2008, 11:36:57 PM
Hi, is the debian package going to be updated someday? Since the best answer is a patch, I'm on my way. I didn't find a source package for your deb, so I started off the current debian version, with only minor changes required to adapt it to MMA 1.4 (already!).
It may be useful to note the debian bugs related to this: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=481916 (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=481916) and http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=341684 (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=341684).

While I'm on it I have a question for Bob regarding the manpage for mma-libdoc. It is currently in section 1, but I'd say it's a system management command (should be run as root!) and belongs in section 8.


Title: Re: DEB package, please test
Post by: wvengen on October 01, 2008, 11:44:20 PM
Oh, and another very minor thing: the manpage of mma-renum mentions 'mma-libdoc is Copyright...' at the bottom, that should of course be 'mma-renum is Copyright...'.
It may be useful to note that if mma-libdoc is moved to section 8, also the see also paragraphs in the other manpages need updating :)


Title: Re: DEB package, please test
Post by: bvdp on October 02, 2008, 12:20:19 AM
I'm a bit confused about the debian update request. The debian on the site is for 1.4 ... the name of the package is "mma_1.4_all.deb" .... are we on the same page :) Or are you talking about the deb package in the repositories which I have no control over. The debian package on my site is identical to the binary package (well, the PDFs are added in).

The bug reports you mention (not from me) mention newer versions but no replies. I've also posted a plea on the ubuntu forums without response. I don't have the time to fight this battle, but really would appreciate someone who knows the ins and outs of the the debian stuff to take over the deb package!

Okay on the man pages. I've just made the suggested changes and uploaded a new package. No name change since it's so minor.

I appreciate the help and comments on this. This packing all looks so easy :)

If you are volunteering I can send the relevant parts of the Makefile which should make it easy to recreate? Whatever, best contact me via PM if you want to take this on.




Title: Re: DEB package, please test
Post by: wvengen on October 02, 2008, 12:35:55 AM
With the debian package update I meant an update of the package in the repository of the Debian distribution. That means replying to a bug report with a patch and wait for a debian developer to pick it up so the version in debian/unstable can be updated. After sufficient testing, the new package appears in debian/testing and later debian/stable.

Debian packages are usually built from their debianized source with standard tools. For Python programs no compilation is needed, so there is little difference between a source and binary package (*). This is explained on http://www.debian.org/doc/manuals/maint-guide/index.en.html , if you would like some more background. With `apt-get source mma` on a debian box (with the appropriate deb-src lines in /etc/apt/sources.list) you can get the source package.

In the meanwhile I think I've finished a debian package that is created from a debianised source. I'll look if I can attach that to a debian bug report, if possible.


(*) That is almost true: no compilation is needed to create a debian package from the debian source, but the package-build-process creates a package that compiles .py to .pyc files at installation time.


Title: Re: DEB package, please test
Post by: wvengen on October 02, 2008, 10:07:30 AM
Ok, my work-in-progress packages are available at http://willem.engen.nl/debian/ (http://willem.engen.nl/debian/)
I've added a groove database generation stap at install time. Debian bug #481916 was also notified, I hope finally a new version will get into Debian.
If you have any comments, please let me know.


Title: Re: DEB package, please test
Post by: Oren on October 02, 2008, 02:43:47 PM
Ok, my work-in-progress packages are available at http://willem.engen.nl/debian/ (http://willem.engen.nl/debian/)
I've added a groove database generation stap at install time. Debian bug #481916 was also notified, I hope finally a new version will get into Debian.
If you have any comments, please let me know.
wvengen,
Thanks for your efforts on this!
 Poor bvdp is a bit of a lonely guy around here, because although we all admire his work, few of us can follow the Linux command-line flow. GUIs have spoiled us... ::)
Oren.


Title: Re: DEB package, please test
Post by: bvdp on October 03, 2008, 12:22:56 AM

 Poor bvdp is a bit of a lonely guy around here, because although we all admire his work, few of us can follow the Linux command-line flow. GUIs have spoiled us... ::)
Oren.

So lonely I had to write MMA to have friends to play with :)

Seriously, try MMA with LeMMA which gives you a decent GUI. Only problem with a GUI like LeMMA is that you don't get all the power of MMA, but it's pretty complete and foolproof.


Title: Re: DEB package, please test
Post by: bvdp on October 04, 2008, 06:20:00 PM

I just reloaded the .deb package to reflect the proper version 1.4 (not 1.3b). This really makes no difference if you have already downloaded/installed this.

I've also created an RPM package based off the DEB. I just ran ALIEN over the .deb and it appears to be fine.

As always, shout if problems.

Bob.


Title: Re: DEB package, please test
Post by: yam655 on December 27, 2008, 08:35:53 AM
Here's a hint to make sense of the Lintian output:

Use: lintian -i mma*.deb

The -i gives detailed information about each "tag" it displays. Better than that, it also displays some clue as to how to solve the issue.

~/Desktop$ lintian -i mma_1.4_all.deb                     
W: mma: manpage-has-bad-whatis-entry usr/share/man/man1/mma-renum.1.gz       
N:                                                                           
N:   Each manual page should start with a `NAME' section, which lists the     
N:   name and a brief description of the page seperated by '\-'. These       
N:   sections are parsed by `mandb' and stored in a database for the use of   
N:   `apropos' and `whatis', so they must be in a certain format. This       
N:   manual page apparently uses the wrong format and cannot be parsed by     
N:   `mandb'.                                                                 
N:                                                                           
N:   For information on how `NAME' sections should be written see             
N:   lexgrog(1). See also groff_man(7) and groff_mdoc(7) for general         
N:   information on writing manual pages.                                     
N:                                                                           
W: mma: manpage-has-bad-whatis-entry usr/share/man/man8/mma-libdoc.8.gz       
W: mma: extra-license-file usr/share/mma/text/COPYING                         
N:                                                                           
N:   All license information should be collected in the debian/copyright     
N:   file. This usually makes it unnecessary for the package to install       
N:   this information in other places as well.                               
N:                                                                           
N:   Refer to Policy Manual, section 12.5 for details.                       
N:                                                                           
W: mma: package-contains-empty-directory usr/share/mma/includes/aria/         
N:                                                                           
N:   This package installs an empty directory. This might be intentional     
N:   but it's normally a mistake. If it is intentional, add a lintian         
N:   override.                                                               
N:                                                                           
W: mma: command-with-path-in-maintainer-script postinst:8 /usr/bin/mma       
N:                                                                           
N:   The indicated program run in a maintainer script has a prepended path.   
N:   Programs called from maintainer scripts normally should not have a       
N:   path prepended. dpkg ensures that the PATH is set to a reasonable       
N:   value, and prepending a path may prevent the local administrator from   
N:   using a replacement version of a command for some local reason.         
N:                                                                           
N:   Refer to Policy Manual, section 6.1 for details.                         
N:                                                                           
W: mma: old-fsf-address-in-copyright-file                                     
N:                                                                           
N:   The /usr/share/doc/<pkg>/copyright file refers to the old postal         
N:   address of the Free Software Foundation (FSF). The new address is:       
N:                                                                           
N:     Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,   
N:     MA 02110-1301, USA.                                                   
N:                                                                           
E: mma: copyright-should-refer-to-common-license-file-for-gpl                 
N:                                                                           
N:   The strings "GNU General Public License" or "GPL" appear in the         
N:   copyright file for this package, but the copyright file does not         
N:   reference /usr/share/common-licenses as the location of the GPL on       
N:   Debian systems.                                                         
N:                                                                           
N:   If the package uses some other license that just mentions the GPL and   
N:   that Lintian should detect as an exception, please file a Lintian bug.   
N:   If the copyright file must mention the GPL for reasons other than       
N:   stating the license of the package, please add a Lintian override.       
N:                                                                           
N:   Refer to Policy Manual, section 12.5 for details.                       
N:                                                                           
W: mma: copyright-without-copyright-notice                                   
N:                                                                           
N:   The copyright file for this package does not appear to contain a         
N:   copyright notice. You should copy the copyright notice from the         
N:   upstream source (or add one of your own for a native package). A         
N:   copyright notice must consist of Copyright, Copr., or the Unicode       
N:   symbol of C in a circle followed by the years and the copyright         
N:   holder. A copyright notice is not required for a work to be             
N:   copyrighted, but Debian requires the copyright file include the         
N:   authors and years of copyright, and including a valid copyright notice   
N:   is the best way to do that.                                             
N:                                                                           
N:   If the package is in the public domain rather than copyrighted, be       
N:   sure to mention "public domain" in the copyright file. Please be aware   
N:   that this is very rare and not the same as a DFSG-free license. True     
N:   public domain software is generally limited to such special cases as a   
N:   work product of a United States government agency.                       
N:                                                                           
N:   Refer to http://ftp-master.debian.org/REJECT-FAQ.html for details.       
N:                                                                           
W: mma: description-synopsis-might-not-be-phrased-properly                   
N:                                                                           
N:   The synopsis (first line in the package "Description:" field, the       
N:   short description) ends with a full stop "." character. This is not     
N:   necessary, as the synopsis doesn't need to be a full sentence. It is
N:   recommended that a descriptive phrase is used instead.
N:
N:   Note also that the synopsis is not part of the rest of the
N:   "Description:" field.
N:
N:   Refer to Policy Manual, section 3.4.1 for details.
N:
E: mma: changelog-file-missing-in-native-package
N:
N:   Each Debian package (which provides a /usr/share/doc/<pkg> directory)
N:   has to install a changelog file. Since this package seems to be a
N:   native Debian package (i.e., there is no upstream source), the file
N:   should usually be installed as /usr/share/doc/<pkg>/changelog.gz
N:
N:   Refer to Policy Manual, section 12.7 for details.
N:
E: mma: essential-no-not-needed
N:
N:   Having `Essential: no' is the same as not having the field at all, so
N:   it just makes the Packages file longer with no benefit.
N:
N:   Refer to Policy Manual, section 5.6.9 for details.
N:

With regards to the binary paths mentioned previously, any package shipped in a Debian-style package should have executables located directly off of / or /usr (as appropriate). /usr/local is reserved for the local administrator to use as desired. Debian packages should never put anything in that tree. This is actually mentioned in the Linux Filesystem Standard. Debian policy requires the packages to comply with the Linux Filesystem Standard.

To my knowledge, the package fails to comply with the Linux Filesystem Standard, as the package assumes the /usr tree is writable. -- The .mmaDB files should actually be located in /var/lib/mma. I may be wrong here, but it "feels" wrong to me. Anything that is generated and can be recreated should typically be in /var.

There's a whole separate package for the Python Policy. http://www.debian.org/doc/packaging-manuals/python-policy/

It should clarify exactly how the pyc files get processed. There is a standard process to handle this which will actually handle it for all installed Python versions. This will include future Python versions that get installed between MMA upgrades. (Last I checked there were two valid options for this task, as they have two different tools to do the task.)

I'm not an actual Debian package maintainer, but I do create internal Debian packages for my job. This has given me more exposure to the tools than most.

I heard about the package because of the availability in Ubuntu's Universe repository. It definitely looks neat.


Title: Re: DEB package, please test
Post by: bvdp on December 28, 2008, 01:46:46 AM
Thanks. I'm make a note of the items you have here.

I was hoping that someone else (sorry, a real person, but I don't recall the name) would complete his own package and put it in the deb repositories. If you want to volunteer ... you are quite welcome.

Quote
To my knowledge, the package fails to comply with the Linux Filesystem Standard, as the package assumes the /usr tree is writable. -- The .mmaDB files should actually be located in /var/lib/mma. I may be wrong here, but it "feels" wrong to me. Anything that is generated and can be recreated should typically be in /var.
 

.mmaDB files are generated by mma-libdoc. I'd hate to see the database files separated from the data. It's probably not a big issue in the end since I don't think many folks are creating their own library files. Ummm, I guess we could put all the lib stuff in a /var location ... but then that doesn't feel right either.

Interesting that debian assumes that /usr is NOT writable. I can't tell you how many .tar.gz files there are there, esp. for docs. Maybe I'm doing it all wrong, but to view certain docs I have to "sudo some-unzip-command".

I'd love to not maintain the deb or rpm packages ... so I really do hope you like MMA and volunteer!!!!