Announcement

Collapse
No announcement yet.

Seriously basic .deb package???

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Seriously basic .deb package???

    I have a couple small servicemenus and associated scripts that I have written. I want to package them so my son can install them without any effort (not a geek).

    There are a couple of "depends" not in the default Kubuntu release so a simple tarball won;t do it (I think).

    So what I want to do is make a very simple .deb package for my own use that will check/install the depends and then the files.

    In total it's six servicemenus and two .sh script files that I want to put into the existing ~/.kde/share/kde4/services/ServiceMenus/ and into a new folder ~/.kde/scripts/.

    I've looked through several How To's but they're all really complex.

    Is there an easy way to do this?

    So far my control file looks like:
    Code:
    Package: youtubeservicemenuVersion: 0.1
    Section: web 
    Priority: optional
    Architecture: all
    Essential: no
    Depends: xclip, youtube-dl, kdialog
    Pre-Depends: dolphin
    Recommends:  
    Suggests: 
    Installed-Size: 
    Maintainer: 
    Description: Service menu to automate downloading youtube videos and audio.
    .

    Please Read Me

    #2
    Maybe

    Guides:

    - https://wiki.ubuntu.com/PackagingGuide/Complete
    - http://developer.ubuntu.com/packaging/html/
    - https://launchpad.net/~ubuntu-packag...m/+archive/ppa


    I would...an example

    Packages needed:

    -dpkg-dev
    Description: Debian package development tools
    This package provides the development tools (including dpkg-source)
    required to unpack, build and upload Debian source packages.
    .
    Most Debian source packages will require additional tools to build;
    for example, most packages need make and the C compiler gcc.

    - debhelper
    Description: helper programs for debian/rules
    A collection of programs that can be used in a debian/rules file to
    automate common tasks related to building debian packages. Programs
    are included to install various files into your package, compress
    files, fix file permissions, integrate your package with the debian
    menu system, debconf, doc-base, etc. Most debian packages use debhelper
    as part of their build process.

    Homepage: http://kitenet.net/~joey/code/debhelper/
    - fakeroot
    Description: tool for simulating superuser privileges
    fakeroot provides a fake "root environment" by means of LD_PRELOAD and
    SysV IPC (or TCP) trickery. It puts wrappers around getuid(), chown(),
    stat(), and other file-manipulation functions, so that unprivileged
    users can (for instance) populate .deb archives with root-owned files;
    various build tools use fakeroot for this by default.

    Directories and files

    Making a direcory: kde-service-menu-thumbnail-remover-0.1.
    Making the sub directories: debian, desktop, scripts.

    That is:
    kde-service-menu-thumbnail-remover-0.1
    /debian
    /desktop
    /scripts
    The desktop sub directory has the service menu desktop files.

    The script sub directory has the script files.

    The debian sub directory has files: changelog, compat, control, kde-service-menu-thumbnail-remover.install, rules

    changelog
    Code:
    kde-service-menu-thumbnail-remover (0.1) null; urgency=low
    
      * Initial release.
    
     -- You Know <not_telling@mail.om>  Sun, 30 Sep 2012 14:13:00 +0300
    compat
    Code:
    8
    control
    Code:
    Source: kde-service-menu-thumbnail-remover
    Section: kde
    Priority: extra
    Maintainer: You Know <not_telling@mail.om>
    Build-Depends: debhelper (>= 8.0)
    Standards-Version: 3.9.3
    Homepage: <insert the upstream URL, if relevant>
    
    Package: kde-service-menu-thumbnail-remover
    Architecture: all
    Depends: dolphin | konqueror, perl
    Description: a video thumbnail remover
     A KDE service menu to remove selected video thumbnails.
     . 
     This service menu is using a Perl scrip ( video-thumbnail-remover.pl ) 
     to remove the selected video thumbnails.
    kde-service-menu-thumbnail-remover.install
    Code:
    desktop/*  /home/oneline/.kde/share/kde4/services/ServiceMenus/
    scripts/* /home/oneline/.bin/
    man dh_install:
    ...
    FILES
    debian/package.install
    List the files to install into each package and the directory they should be installed to. The format is a
    set of lines, where each line lists a file or files to install, and at the end of the line tells the
    directory it should be installed in. The name of the files (or directories) to install should be given
    relative to the current directory, while the installation directory is given relative to the package build
    directory. You may use wildcards in the names of the files to install (in v3 mode and above).

    Note that if you list exactly one filename or wildcard-pattern on a line by itself, with no explicit
    destination, then dh_install will automatically guess the destination to use, the same as if the --autodest
    option were used.
    ...
    rules
    Code:
    #!/usr/bin/make -f
    
    %:
    	dh $@

    Wrapping the package

    The Konsole is in the kde-service-menu-thumbnail-remover-0.1. The command is:
    Code:
    dpkg-buildpackage -b -rfakeroot -us -uc
    .../kde-service-menu-thumbnail-remover-0.1$ dpkg-buildpackage -b -rfakeroot -us -uc
    dpkg-buildpackage: source package kde-service-menu-thumbnail-remover
    dpkg-buildpackage: source version 0.1
    dpkg-buildpackage: source changed by You Know <not_telling@mail.om>
    dpkg-buildpackage: host architecture amd64
    dpkg-source --before-build kde-service-menu-thumbnail-remover-0.1
    fakeroot debian/rules clean
    dh clean
    dh_testdir
    dh_auto_clean
    ...
    dh_builddeb
    dpkg-deb: building package `kde-service-menu-thumbnail-remover' in `../kde-service-menu-thumbnail-remover_0.1_all.deb'.
    dpkg-genchanges -b >../kde-service-menu-thumbnail-remover_0.1_amd64.changes
    dpkg-genchanges: binary-only upload - not including any source code
    dpkg-source --after-build kde-service-menu-thumbnail-remover-0.1
    dpkg-buildpackage: binary only upload (no source included)
    There is a deb package: kde-service-menu-thumbnail-remover_0.1_all.deb

    Testing

    Installing...





    Now there is:
    $ apt-cache show kde-service-menu-thumbnail-remover
    Package: kde-service-menu-thumbnail-remover
    Status: install ok installed
    Priority: extra
    Section: kde
    Installed-Size: 58
    Maintainer: You Know <not_telling@mail.om>
    Architecture: all
    Version: 0.1
    Depends: dolphin | konqueror, perl
    Description: a video thumbnail remover
    A KDE service menu to remove selected video thumbnails.
    .
    This service menu is using a Perl scrip ( video-thumbnail-remover.pl )
    to remove the selected video thumbnails.
    Homepage: <insert the upstream URL, if relevant>
    $ dpkg -L kde-service-menu-thumbnail-remover
    /.
    /home
    /home/oneline
    /home/oneline/.bin
    /home/oneline/.bin/video-thumbnail-remover.pl
    /home/oneline/.kde
    /home/oneline/.kde/share
    /home/oneline/.kde/share/kde4
    /home/oneline/.kde/share/kde4/services
    /home/oneline/.kde/share/kde4/services/ServiceMenus
    /home/oneline/.kde/share/kde4/services/ServiceMenus/video-thumbnail-remover.desktop
    /usr
    /usr/share
    /usr/share/doc
    /usr/share/doc/kde-service-menu-thumbnail-remover
    /usr/share/doc/kde-service-menu-thumbnail-remover/changelog.gz
    It seems to work...



    Note

    At this case the user's home was used as:
    ...I want to put into the existing ~/.kde/share/kde4/services/ServiceMenus/ and into a new folder ~/.kde/scripts/...
    The installation needs the roots rights - installed files are owned by the root:
    $ ls -l /home/oneline/.kde/share/kde4/services/ServiceMenus/video-thumbnail-remover.desktop
    -rw-r--r-- 1 root root 398 Sep 30 14:32 /home/oneline/.kde/share/kde4/services/ServiceMenus/video-thumbnail-remover.desktop
    Last edited by OneLine; Oct 02, 2012, 02:46 AM.
    Have you tried ?

    - How to Ask a Question on the Internet and Get It Answered
    - How To Ask Questions The Smart Way

    Comment


      #3
      WOW, Ok thanks! I'll work on that this week....

      ..once I work out a bug in my script.

      Thanks again.

      Please Read Me

      Comment


        #4
        The /opt option

        With the Debian package management the installation to the user's home is a bit clumsy. There are other options.

        By the http://techbase.kde.org/Development/..._Service_Menus
        ...These servicemenu files are found in

        1) $KDEHOME/share/services/ServiceMenus,
        2) the directory KDE was installed to
        3) or any directory listed in the $KDEDIRS environment variable...

        An alternative to the $KDEDIRS a.k.a Drag&Drop

        1) Install the desktop files and executables to the /opt

        http://www.linuxtopia.org/online_boo...ystem/opt.html :
        This directory is reserved for all the software and add-on packages that are not part of the default installation...
        At here the kde-service-menu-thumbnail-remover.install:
        desktop/* /opt/kde4/share/services/ServiceMenus/
        scripts/* /opt/bin/
        2) Drag&Drop the /opt/kde4/share/services/ServiceMenus/ to the ~/.kde/share/kde4/services/ServiceMenus/. Pick the link option.



        $ ls -l ~/.kde/share/kde4/services/ServiceMenus/
        total 0
        lrwxrwxrwx 1 oneline oneline 37 Sep 30 20:24 ServiceMenus -> /opt/kde4/share/services/ServiceMenus
        3) Use.

        The /opt/bin/ directory could be added to the $PATH or the desktop files Exec key could be pointing to the script file; at here the video-thumbnail-remover.desktop has:
        ...
        Exec=perl /opt/bin/video-thumbnail-remover.pl "%U"
        ...
        Have you tried ?

        - How to Ask a Question on the Internet and Get It Answered
        - How To Ask Questions The Smart Way

        Comment

        Working...
        X