You are not logged in.

#1 2008-12-15 15:48:42

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Installing "dummy" packages in pacman

I have an issue, and I've searched around, but found nothing. So here goes big_smile

Say a situation where I'd like to (or have to) install a piece of software without going though pacman, but still like it to be implemented in the database of pacman, so other PKGBUILDs will be aware that my dependency actually is there. I've heard about wocka in AUR, but it didn't work/compile on my Arch64 setup. I've made some "emtpy" packages by hand to counter this problem, but that is tedious. What I could use is something like:

pacman -D (dummy package tongue) mplayer, that simply installs an "empty" mplayer package. If this exists already, in a script or a hidden function in pacman, I'd be happy big_smile If it doesn't I could start freshing up my bash-skills >_<

Last edited by Themaister (2008-12-15 15:50:55)

Offline

#2 2008-12-15 15:52:52

dcrabs
Member
From: Sweden
Registered: 2008-10-03
Posts: 149

Re: Installing "dummy" packages in pacman

Hi
I guess that's what you need: http://www.methylblue.com/wocka/
David

Offline

#3 2008-12-15 15:55:51

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: Installing "dummy" packages in pacman

"I've heard about wocka in AUR, but it didn't work/compile on my Arch64 setup." :\

Offline

#4 2008-12-15 16:04:23

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Installing "dummy" packages in pacman

Can you give an example of when it would be useful to install something without using pacman but make pacman pretend that it installed it?

Somehow that's like working for free and getting your boss to agree to pretend that he paid you.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#5 2008-12-15 16:11:06

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: Installing "dummy" packages in pacman

Well, in my case I had to install mplayer from source manually, for some reason when using a PKGBUILD, it wouldn't detect fontconfig properly when using the program (very annoying when watching anime ...) I've tried 5-6 different PKGBUILDs ... But doing it manually, with the exact same procedure as the PKGBUILDs take, it just works. If

Also, in the case of installing the nvidia-driver that provides libgl. If I'd want to install it manually, pacman wouldn't like that some packages need libgl (which nvidia provides, but isn't detected by PKGBUILDs) so, installing a dummy libgl package would be necessary here.

Last edited by Themaister (2008-12-15 16:15:12)

Offline

#6 2008-12-15 16:24:34

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Installing "dummy" packages in pacman

I would write a script to check exactly where the files get installed (comparison of before and after), then stick all of them in a pkg that way.

If I remember later, I might add something like that to pacpal or another utility I've had in mind for a while.

That said, you can probably get it working with a proper install file in the pkgbuild, even if it might be difficult to create.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#7 2008-12-15 16:35:48

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: Installing "dummy" packages in pacman

That could be an idea. I'm starting writing a simple script. I just need a method to let pacman know that a certain package has been installed manually, have a method to list every manually built package on the system and such.

Offline

#8 2008-12-15 17:31:39

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Installing "dummy" packages in pacman

Perhaps you could place the pacman package in a cachedir for manual entry.

Since it is a .pkg.tar.gz, you could copy it to /var and pacman would then recognize it.

Perhaps I am confused about your need?


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#9 2008-12-15 18:20:19

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: Installing "dummy" packages in pacman

Well... I created a script now that covers it pretty much smile

usage:
dummypkg -S foo version    installs a dummy pkg with pkgver=version, a file that resembles the package name and version in /etc/dummy (uses sudo for pacman)
dummypkg -R foo       checks if foo has been installed by dummypkg and removes it with pacman
dummypkg -l              lists all packages and package versions of all packages installed by dummypkg

temporary building is done in ~/.dummypkg-tmp/


#!/bin/bash

###########
#####
##       Dummypkg v0.1
#####
###########

## Script to install dummy packages in pacman

## Use at own risk!

function install(){
    if [ -d ~/.dummybuild-tmp/$PACKAGE ]; then
       rm -r ~/.dummybuild-tmp/$PACKAGE 
    fi
    
    mkdir -p ~/.dummybuild-tmp/$PACKAGE
    echo "pkgname=$PACKAGE" >> ~/.dummybuild-tmp/$PACKAGE/PKGBUILD
    echo "pkgver=$PKGVER" >> ~/.dummybuild-tmp/$PACKAGE/PKGBUILD
    echo "pkgrel=1" >> ~/.dummybuild-tmp/$PACKAGE/PKGBUILD
    echo "pkgdesc=\"Dummy package created by dummypkg\"" >> ~/.dummybuild-tmp/$PACKAGE/PKGBUILD
    echo "arch=('i686' 'x86_64')" >> ~/.dummybuild-tmp/$PACKAGE/PKGBUILD
    echo "url=""" >> ~/.dummybuild-tmp/$PACKAGE/PKGBUILD
    echo "license=\"GPL\"" >> ~/.dummybuild-tmp/$PACKAGE/PKGBUILD
    echo "depends=()" >> ~/.dummybuild-tmp/$PACKAGE/PKGBUILD
    echo "source=()" >> ~/.dummybuild-tmp/$PACKAGE/PKGBUILD
    echo "build(){" >> ~/.dummybuild-tmp/$PACKAGE/PKGBUILD
    echo "mkdir -p ~/.dummybuild-tmp/$PACKAGE/pkg/etc/dummy" >> ~/.dummybuild-tmp/$PACKAGE/PKGBUILD
    echo "echo >> \"Installed by dummypkg\" >> ~/.dummybuild-tmp/$PACKAGE/pkg/etc/dummy/$PACKAGE-$PKGVER" >> ~/.dummybuild-tmp/$PACKAGE/PKGBUILD
    echo "}" >> ~/.dummybuild-tmp/$PACKAGE/PKGBUILD
    
    cd ~/.dummybuild-tmp/$PACKAGE/
    makepkg || exit 1
    sudo pacman -U *pkg.tar.gz
    cd ~
    rm -r .dummybuild-tmp/
    exit 0
}

function remove(){
   if [ -e /etc/dummy/$RPACKAGE* ]; then
     sudo pacman -R $RPACKAGE
   else
     echo "This package is not installed by dummypkg ... Exiting"
     exit 1
   fi
   exit 0
}

function list(){
    for file in `ls /etc/dummy -1` 
    do
       
          echo ">>  $file"
       
    done
    exit 0
}

function usage(){
    echo "usage: info [[--install] [--list] [--help] [--remove] [--version]]"
    exit 0
}


INSTALL=0
REMOVE=0
LIST=0



if [ "$1" = "" ]; then
    usage ; exit 1
fi 
while [ "$1" != "" ]; do
    case $1 in
        -S | --install )    
            INSTALL=1 
            PACKAGE="$2"
            PKGVER="$3"
            if [ "$2" = "" ]; then
                echo "--install requires a package name"
                exit 1
            fi
            if [ "$3" = "" ]; then
                echo "--install requires a package version"
                exit 1
            fi
            shift
            shift
            ;;
        -R | --remove )    
                REMOVE=1 
                RPACKAGE="$2"
                if [ "$2" = "" ]; then
                    echo "--remove requires a package name"
                    exit 1
                fi
                shift 
                ;;
        -h | --help  )    usage; exit 0 ;;
        -l | --list   )    LIST=1 ;;
        * )               usage ; exit 1 
    esac
    shift
done



if [ $INSTALL = 1 ]; then
  install
fi
if [ $REMOVE = 1 ]; then
   remove
fi
if [ $LIST = 1 ]; then
   list
fi

Last edited by Themaister (2008-12-15 18:26:26)

Offline

#10 2008-12-15 18:40:42

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Installing "dummy" packages in pacman

Umm, the whole rationale sounds flawed to me... "The PKGBUILD didn't detect fontconfig right, so I just want to hit it with a hammer a few times and force it to work".

Seems like determining why the PKGBUILD failed would be a more ideal solution, if you ask me.

Offline

#11 2008-12-15 19:29:12

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: Installing "dummy" packages in pacman

Well, the PKGBUILD for mplayer actually worked if it's built with --asroot (no fakeroot?), I figured now, but that's a pretty dirty solution tongue But that alone was not the motivation for this topic though ... tongue

Last edited by Themaister (2008-12-15 19:42:17)

Offline

#12 2008-12-16 02:34:52

jacko
Member
Registered: 2007-11-23
Posts: 840

Re: Installing "dummy" packages in pacman

Themaister wrote:

Well, the PKGBUILD for mplayer actually worked if it's built with --asroot (no fakeroot?), I figured now, but that's a pretty dirty solution tongue But that alone was not the motivation for this topic though ... tongue

So exactly where is your fontconfig located at? The root level or the user level?

Offline

#13 2008-12-16 02:38:10

jacko
Member
Registered: 2007-11-23
Posts: 840

Re: Installing "dummy" packages in pacman

Also, in the case of installing the nvidia-driver that provides libgl. If I'd want to install it manually, pacman wouldn't like that some packages need libgl (which nvidia provides, but isn't detected by PKGBUILDs) so, installing a dummy libgl package would be necessary here.

No worries, since xorg-server 1.5.3, I beleive even the nvidia driver uses xorg-server libgl now instead of it's own version.

Offline

#14 2008-12-16 05:32:13

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Installing "dummy" packages in pacman

Just to clarify, what I had in mind would be a script to do this:
Grab a file list just before manual installation.
Grab a file list just after installation.
Compare the 2 and get the list of possibly installed files.
Open a dialogue and confirm that each file should be a part of the new package.
Move all the files into a directory keeping the relative paths, generate the necessary pkg files (.PKGINFO, etc), tar.gz it.
Install with pacman.

This would still be a dirty, but not as filthy as the dummy packages method.

Still though, as already mentioned, figuring out how to get the PKGBUILD to work in the first place is the right way to go. It's a far more elegant adaptation.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB