Puppizard 008

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

puppy ports 003

#31 Post by L18L »

Thank you,
it will take some time on my 1.5GHz, now I will logout.

Edited 2011-07-05
There are some marginal differences in size.
# pwd
/mnt/+initrd+mnt+dev_save+wary511q+warysave.3fs/root/test686/686/usr/bin
# ls -l
total 464
-rwxr-xr-x 1 root root 108724 2011-06-26 15:44 advdef
-rwxr-xr-x 1 root root 129536 2011-06-26 15:44 advmng
-rwxr-xr-x 1 root root 96448 2011-06-26 15:44 advpng
-rwxr-xr-x 1 root root 118248 2011-06-26 15:44 advzip
#
# pwd
/mnt/+initrd+mnt+dev_save+wary511q+warysave.3fs/root/test686/386/usr/bin
# ls -l
total 464
-rwxr-xr-x 1 root root 108724 2011-06-26 15:32 advdef
-rwxr-xr-x 1 root root 129472 2011-06-26 15:32 advmng
-rwxr-xr-x 1 root root 96448 2011-06-26 15:32 advpng
-rwxr-xr-x 1 root root 118052 2011-06-26 15:32 advzip
#

i386 is making smaller files :!:
Last edited by L18L on Tue 05 Jul 2011, 17:59, edited 3 times in total.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Puppy Ports 003

#32 Post by L18L »

jpeps wrote:
Iguleder wrote:It doesn't get stuck - Homebank has heaps of PNG files and optimizing them takes ages.
Yeah, it did. I went out to do an errand, and came back a few hours later and the original "building homebank" (or something to that effect) was still there. I closed it out, and tried running the CLI, and the installation GUI appeared.
My observation is:
pur-gui started from command line makes a messages at top of screen.
I went out too, came back and waited and waited ....
The process started after hovering the messages. It was very fast then. :)

This could be called get stuck

I would call it unexpected behavior.

SimpleWater
Posts: 94
Joined: Tue 19 Apr 2011, 11:53

#33 Post by SimpleWater »

Not to be a downer or anything, but does this method not provide more work? Would it not be easier if you could do something like "pur build http://website.org/source.tgz"? Or what about a script that makes a build script?

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#34 Post by Iguleder »

No, of course not... how can you make the computer able to understand what a sources tarball contains? How is the script supposed to determine the package in the tarball and how to build it?

And what if it needs some patching or special care to be built correctly? :idea:

And if you want a script that generates build scripts - build a robot that resembles the human brain and spirit perfectly. Then program the AI :lol:
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#35 Post by Iguleder »

Just to let you know, guys - I'm working on an improved version of the whole thing. This one is safer and smarter in many areas.

I also wrote an Opera build script, which makes a package from the official Opera installer - quite useful for keeping the system clean.

Here's what the new aterm build script looks like:

Code: Select all

#!/bin/sh

PKG_NAME="aterm"
PKG_VER="1.0.1"
PKG_REV="1"
. /usr/share/pkg/default

download() {
	# download the sources
	for file in ftp://ftp.afterstep.org/apps/$PKG_NAME/$PKG_NAME-$PKG_VER.tar.bz2 http://www.afterstep.org/data/php/desktop/icons/rxvt.png
	do
		wget $file
		[ $? -ne 0 ] && return 1
	done
	return 0
}

build() {
	# extract the sources
	tar -xvf $PKG_NAME-$PKG_VER.tar.bz2
	[ $? -ne 0 ] && exit 1

	cd $PKG_NAME-$PKG_VER

	# configure the package
	CFLAGS="$CFLAGS" ./configure $BASE_CONFIGURE_ARGS --prefix=/usr \
	                             --disable-utmp --disable-wtmp \
	                             --disable-kanji --disable-big5 \
	                             --disable-greek --disable-thai \
	                             --disable-ttygid --enable-xgetdefault \
	                             --disable-memset --disable-dmalloc \
	                             --disable-dlmalloc --disable-gdb \
	                             --disable-sigsegv --enable-transparency \
	                             --without-libefence --disable-fading \
	                             --disable-background-image \
	                             --disable-next-scroll --enable-xterm-scroll \
	                             --disable-menubar --disable-graphics \
	                             --disable-half-shadow 
	[ $? -ne 0 ] && return 1

	# build the package
	make -j $BUILD_THREADS
	[ $? -ne 0 ] && return 1

	return 0
}

package() {	
	# install the package
	make DESTDIR=$INSTALL_DIR install
	[ $? -ne 0 ] && return 1

	cd ..
	
	# create symlinks for compatibility with existing stuff that rely on rxvt
	ln -s aterm $INSTALL_DIR/usr/bin/rxvt
	ln -s aterm $INSTALL_DIR/usr/bin/urxvt
	ln -s aterm $INSTALL_DIR/usr/bin/xterm

	# create a menu entry
	mkdir -p $INSTALL_DIR/usr/share/applications
	echo '[Desktop Entry]
	Encoding=UTF-8
	Name=Aterm
	GenericName=Terminal emulator
	Comment=command line shell
	Exec=aterm
	Icon=aterm
	Type=Application
	Categories=Utility;TerminalEmulator;' > $INSTALL_DIR/usr/share/applications/aterm.desktop

	# add the icon
	mkdir -p $INSTALL_DIR/usr/share/pixmaps
	mv rxvt.png $INSTALL_DIR/usr/share/pixmaps/aterm.png
	
	return 0
}
There's a wrapper called "buildpkg" which runs the build scripts in a dedicated directory and takes care of all error handling. It also takes care of the package creation, so this code appears only once. Makes life easier.

Tomorrow I guess I'm gonna rewrite many of the build scripts in the new format and build another E17. I did a rebuild today and I see E17 improves with every revision :D
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

noryb009
Posts: 634
Joined: Sat 20 Mar 2010, 22:28

#36 Post by noryb009 »

Great start, Iguleder!

I found a bug: Open the GUI, and immediately click and hold the scrollbar. Once it's done loading all the scripts, let go. The packages added to the list while you had the scroll bar held would have $something as the version
I only tested it on the first opening, on lupu 520.

A few suggestions:
- with the GUI, open a terminal window with minimal output (downloading, building, etc.)
- have an "Update scripts" command - much easier then making a new version
- warn about approximate size of download/space used after install
- option to install, make a pet, or both (or at least run tgz2pet on the .tgz file)

It's looking good, keep it up!

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#37 Post by Iguleder »

I rewrote the whole backend, now I also want to write a script called "installpkg" and form a mini-package manager, for two reasons:
- PPM ruins packages by modifying .desktop files, it makes menus ugly on DEs and full-blown WMs, especially E17
- I want to utilize XZ compression instead of the traditional gzip

Regarding package update, the algorithm needed to update a package is simple:
build the new package
remove the old package
install the new package
I want to rebuild the GUI and make it run the build script through a terminal window, to make things easier.

And regarding the needed space - there's nothing I can do, since you can't estimate the binary package size.[/quote]
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#38 Post by jpeps »

I think it's a great idea to have a central depository of build scripts for the community.

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#39 Post by Iguleder »

Good news, "installpkg" and "removepkg" are implemented. Still not heavily tested, but I've managed to install and remove aterm successfully.

Now it's time to rewrite the GUI and add more build scripts :)

EDIT: the new GUI is here; see the changes :)
Attachments
puppizard-new.jpg
(43.83 KiB) Downloaded 973 times
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Puppizard 004

#40 Post by L18L »

Iguleder wrote:Good news, "installpkg" and "removepkg" are implemented. Still not heavily tested, but I've managed to install and remove aterm successfully.
my test building opera:

# pwd
/root/operabuild
# installpkg opera
Usage: installpkg [PACKAGE]
# installpkg opera-11.50-1074-1-i386.pxz
tar: Record size = 16 blocks
usr/
usr/share/
usr/share/opera/
{ cut off }
usr/bin/
usr/bin/opera-widget-manager
usr/bin/opera
# opera &
[1] 24911
# :)

aterm
removing aterm made console unusable. (I had to remove the links) :cry:

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#41 Post by Iguleder »

That happens for a good reason, the Aterm build script ovverides rxvt/urxvt for compatibility.

Once you remove Aterm, you have no terminal emulator.
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

noryb009
Posts: 634
Joined: Sat 20 Mar 2010, 22:28

#42 Post by noryb009 »

Looking a little better!

A few things you might want to add:

- check if the files are already downloaded
- have some way to list the scripts from the command line
--- maybe be able to search?
- When using the GUI, it doesn't start downloading/compiling until after you close the message box. Can you start them at the same time?
- A way to update packages from a central repository

How do we submit scripts? Just post them here?

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#43 Post by Iguleder »

Yep! They're yours. You can even post them at the PETs thread if that's acceptable.

Regarding the bugs - I'll do a bug-hunting round this weekend. Thanks for reporting!
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

noryb009
Posts: 634
Joined: Sat 20 Mar 2010, 22:28

#44 Post by noryb009 »

Just a question, how are you going to do (large) dependencies?

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#45 Post by Iguleder »

No dependency handling at all. The base assumption is that this tool is supposed to be simple enough to make it clear enough for users that package X depends or Y, or simple have only packages that don't have extra dependencies.
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

#46 Post by edoc »

Aitch referred me here because I was looking for a way to update Claws-mail in Fluppy 013.

What an amazing piece of coding!

Has anyone tested Claws-mail with Puppizard?

Will the new version overwrite all of the config files and archived E-mails or leave them intact?
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#47 Post by Iguleder »

It should be very easy to write a build script, as you see. I made it very simple to write new build scripts.

Once I'm done with the Puppizard port of the kernel build script, I'll do more :)

EDIT: here's a beta ... loks simple, doesn't it? Just imagine - this could be the way the 5.3 kernel is built. 99% fail-safe and upgradeable!

Code: Select all

#!/bin/sh

PKG_NAME="linux"
PKG_VER="2.6.39.2"
PKG_REV="1"
PKG_DESC="Kernel and drivers"
. /usr/share/pkg/default

# the Aufs version to use
AUFS_VER="2.1"

# the BFS version to use
BFS_VER=406

# the kernel major version (e.g 2.6.32 for 2.6.32.42)
PKG_MAJOR_VER="$(echo $PKG_VER | cut -f 1-3 -d .)"

# the kernel branch (e.g 32 for 2.6.32.42)
PKG_BRANCH="$(echo $PKG_VER | cut -f 3 -d .)"

download() {
	# download the sources and all patches
	for file in http://www.il.kernel.org/pub/linux/kernel/v2.6/$PKG_NAME-$PKG_VER.tar.bz2 \
	            http://ck.kolivas.org/patches/bfs/$PKG_MAJOR_VER/$PKG_MAJOR_VER-sched-bfs-$BFS_VER.patch \
				http://iguleder.info/puppy/kernel/DOTconfig-$PKG_MAJOR_VER-$PKG_ARCH.xz
	do
		wget $file
		[ $? -ne 0 ] && return 1
	done
	
	# download Aufs
	git clone http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git aufs-$AUFS_VER-$PKG_BRANCH
	[ $? -ne 0 ] && return 1	
	cd aufs-$AUFS_VER-$PKG_BRANCH
	git checkout origin/aufs$AUFS_VER-$PKG_BRANCH
	[ $? -ne 0 ] && return 1	
	cd ..
	tar -c aufs-$AUFS_VER-$PKG_BRANCH | xz -9 > aufs-$AUFS_VER-$PKG_BRANCH.tar.xz
	[ $? -ne 0 ] && return 1
	rm -rf aufs-$AUFS_VER-$PKG_BRANCH

	return 0
}

build() {
	# extract the sources
	tar -xjvf $PKG_NAME-$PKG_VER.tar.bz2
	[ $? -ne 0 ] && return 1
	
	tar -xJvf aufs-$AUFS_VER-$PKG_BRANCH.tar.xz
	[ $? -ne 0 ] && return 1
	
	# decompress the configuration file
	unxz DOTconfig-$PKG_MAJOR_VER-$PKG_ARCH.xz
	[ $? -ne 0 ] && return 1
	
	# create the Aufs patch that enables Squashfs file systems to be used as
	# branches
	echo 'diff -rupN aufs2.1-32-git100511-orig//fs/aufs/loop.c aufs2.1-32-git100511/fs/aufs/loop.c
--- aufs2.1-32-git100511-orig//fs/aufs/loop.c	2011-05-11 11:27:21.922000014 +0200
+++ aufs2.1-32-git100511/fs/aufs/loop.c	2011-05-11 11:28:00.310000011 +0200
@@ -28,6 +28,9 @@
  */
 int au_test_loopback_overlap(struct super_block *sb, struct dentry *h_adding)
 {
+	/* allow Squashfs file systems to be used as Aufs branches */
+	return 0;
+	
 	struct super_block *h_sb;
 	struct loop_device *l;' > aufs-allow-sfs.patch
 	[ $? -ne 0 ] && return 1
 	 	
	# patch Aufs
	patch -d aufs-$AUFS_VER-$PKG_BRANCH -p1 < aufs-allow-sfs.patch
	[ $? -ne 0 ] && return 1
	
	cd $PKG_NAME-$PKG_VER
	
	# apply the BFS patch
	patch -p1 < ../$PKG_MAJOR_VER-sched-bfs-$BFS_VER.patch
	[ $? -ne 0 ] && return 1
		
	# clean the sources
	make clean
	[ $? -ne 0 ] && return 1
	make mrproper
	[ $? -ne 0 ] && return 1
	
	# apply the Aufs patches
	for patch in kbuild base standalone
	do
		patch -p1 < ../aufs-$AUFS_VER-$PKG_BRANCH/aufs2-$patch.patch
		[ $? -ne 0 ] && return 1
	done
	
	# add Aufs itself
	for directory in fs Documentation
	do
		cp -r ../aufs-$AUFS_VER-$PKG_BRANCH/$directory .
	done
	
	# clean up patch clutter
	find . -name '*.orig' -delete
	find . -name '*.rej' -delete
	find . -name '*~' -delete

	# reset the kernel version to the major version
	sed -i s/'^EXTRAVERSION = .*$'/'EXTRAVERSION = '/ Makefile
	[ $? -ne 0 ] && return 1

	# lower the number of consoles from 8 to 5
	sed -i s/'#define MAX_CMDLINECONSOLES 8'/'#define MAX_CMDLINECONSOLES 5'/ kernel/printk.c
	[ $? -ne 0 ] && return 1
	
	# reduce the kernel verbosity
	sed -i s/'#define DEFAULT_CONSOLE_LOGLEVEL 7 \/\* anything MORE serious than KERN_DEBUG \*\/'/'#define DEFAULT_CONSOLE_LOGLEVEL 3 \/\* anything MORE serious than KERN_ERR \*\/'/ kernel/printk.c
	[ $? -ne 0 ] && return 1
	
	# add the kernel configuration file
	cp ../DOTconfig-$PKG_MAJOR_VER-$PKG_ARCH .config

	# build the package
	make -j $BUILD_THREADS bzImage modules
	[ $? -ne 0 ] && return 1

	# install the headers and delete unneeded files
	make INSTALL_HDR_PATH=headers/usr headers_install
	[ $? -ne 0 ] && return 1
	find headers/usr/include \( -name .install -o -name ..install.cmd \) -delete
	
	return 0
}

package() {	
	# install the modules
	make INSTALL_MOD_PATH=$INSTALL_DIR modules_install
	[ $? -ne 0 ] && return 1
	
	# fix symlinks to the kernel sources
	for symlink in build source
	do
		rm -f $INSTALL_DIR/lib/modules/$PKG_MAJOR_VER/$symlink
		ln -s /usr/src/linux $INSTALL_DIR/lib/modules/$PKG_MAJOR_VER/$symlink
	done
	
	# add the kernel image and System.map
	mkdir $INSTALL_DIR/boot
	
	# locate the kernel image
	kernel_image="$(find arch -name bzImage -type f)"
	[ -z "$kernel_image" ] && return 1

	install -m644 -D $kernel_image $INSTALL_DIR/boot/vmlinuz
	[ $? -ne 0 ] && return 1
	install -m644 -D System.map $INSTALL_DIR/boot
	[ $? -ne 0 ] && return 1

	# add the kernel API headers
	mv headers/usr $INSTALL_DIR
	
	# clean the kernel sources
	make clean
	cd ..

	# add the kernel sources
	mkdir -p $INSTALL_DIR/usr/src
	cp -r $PKG_NAME-$PKG_VER $INSTALL_DIR/usr/src/linux
	
	return 0}
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#48 Post by technosaurus »

I did something similar for generic packages called Pcompile

http://www.murga-linux.com/puppy/viewtopic.php?t=41758

it uses gtkdialog, but some of the utilities may be useful?
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#49 Post by Iguleder »

Uploaded a new, much improved version. The GUI is the same as in 004, but buildpkg is much more complete and powerful now.

I also made build scripts for many applications, they should be very useful.
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

#50 Post by edoc »

Suggestion:

In addition to the link to your Blog, could you consider a link to Page 1 of this thread in your Sig?

<http://www.murga-linux.com/puppy/viewtopic.php?t=69248>

It would be nice to be able to right-click on it and open as a new Tab or Window - especially as the thread grows longer ....

Thanks again for sharing this tool!
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

Post Reply