You are not logged in.
I maintain a python package on the AUR and I've run into a minor issue. Up until now I have been installing everything manually and symlinking the main file to /usr/bin in the PKGBUILD. An example, assuming this package is named package
package() {
cd "$srcdir/${_pkgname}"
mkdir -p "$pkgdir/usr/lib/package"
install package.py -t "$pkgdir/usr/lib/package"
ln -s "/usr/lib/package/package.py" "$pkgdir/usr/bin/package"
}I've recently done a major restructure in the project, and I wanted to start using python setuptools to install instead. My setup.py looks something like this
setup(
name='package',
version='1.3',
license='GPL3',
url='https://github.com/User/package',
download_url='https://github.com/User/package/archive/v1.3.tar.gz',
packages=['package'],
entry_points={
'console_scripts': [
'package = package.main:run'
]
}
)where package.main:run is equivalent to the old main file, i.e. /usr/bin/package. Performing a test run then yields this error
ModuleNotFoundError: No module named 'package.main'; 'package' is not a packageand I found that, while the main file is actually overwritten, the symlink still exists, and the issue can be solved by removing the main file before installing.
My question is, is there any proper way to handle this? Can I simply rm the file in the package() section of the PKGBUILD before running setup.py, or is that not common practice?
Offline
I'm not even sure what this question means, since a setup.py console_scripts entry for 'package = package.main:run' will create a file "$pkgdir/usr/bin/package" during python setup.py install --root="$pkgdir". Why does the symlink exist at all? Isn't it part of the old PKGBUILD, which is now overwritten by the new version of the package?
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
Is the old symlink causing issues while building the package or at installation ?
If the latter, commands in the pre_upgrade section of a .install script* could be used to remove the old symlink .
Check https://wiki.archlinux.org/index.php/PKGBUILD#install
*maybe a pacman hook could also do this, but a .install feels like the right tool for this job to me.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Is the old symlink causing issues while building the package or at installation ?
If the latter, commands in the pre_upgrade section of a .install script* could be used to remove the old symlink .
Check https://wiki.archlinux.org/index.php/PKGBUILD#install
... did you try that?
pre_upgrade sections of install scripts are run immediately before the package itself is un-tared into the system root, long after pacman has done the "looking for file conflicts" stage of its pre-transaction affairs.
Even PreTransaction alpm-hooks are run after the "looking for file conflicts" stage, though both occur pre-transaction.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline