2023-10-21
This commit is contained in:
parent
edfd476447
commit
1606eecc90
@ -1929,6 +1929,229 @@ If I don't, escalate the issue to the host of this site (this can also be found
|
||||
</HTML>
|
||||
|
||||
|
||||
/blah/2023-10-21.html
|
||||
|
||||
: fuck unrar
|
||||
|
||||
I run Chimera Linux, an Alpine-based operating system still in its very early
|
||||
stages but stable enough that I trust it for my meager, mostly console and X11
|
||||
based workflow. It can run a C compiler, so good enough for me. The only issue
|
||||
is, despite being based on Alpine, a popular operating system not for desktop
|
||||
but for embedded environments like containers, for which a lot of software is
|
||||
packaged and available in system repositories, Chimera does not have a lot of
|
||||
packages. I'm going to package UNRAR, a non-free ("freeware") tool that has no
|
||||
dependencies aside from the C++ standard library, to get a feel for Alpine
|
||||
packaging.
|
||||
|
||||
UNRAR is an almost delightful little tool with the unfortunate, heinous problem
|
||||
of being non-free, and its license forbidding the use of the provided source
|
||||
code for reimplementation - otherwise I would just rewrite it in sane C89
|
||||
without encumbrence. But we don't need to read the source code in order to
|
||||
compile the C++.
|
||||
|
||||
The Alpine Wiki section on Creating an Alpine package says to apk add
|
||||
alpine-sdk but Chimera has no such thing so hopefully that's fine. It says to
|
||||
check out the aports tree but I don't want to put my packages upstream (dealing
|
||||
with large software projects is tiresome and I know Chimera is in a constant
|
||||
state of flux).
|
||||
|
||||
I did this:
|
||||
|
||||
# mkdir -p /var/cache/distfiles
|
||||
# chmod a+w /var/cache/distfiles
|
||||
|
||||
I now need abuild-keygen according to the wiki but it isn't installed.
|
||||
$ apk search abuild-keygen
|
||||
pulled up nothing. Nor did a package contents search. Maybe it's fine? On a
|
||||
whim I searched cbuild* in the contents search and found apk:base-cbuild-progs.
|
||||
# apk add base-cbuild-progs
|
||||
(1/1) Installing base-cbuild-progs (0.1-r2)
|
||||
OK: 2083 MiB in 896 packages
|
||||
|
||||
On the Chimera Linux website I found the Chimera-specific packaging stuff.
|
||||
There is a cports repository with Packaging.md but it's kind of long so I'll
|
||||
use it as a reference while following the less complete Alpine guide. This is
|
||||
the rat bastard approach to software but I am doing this for my own uses and
|
||||
for pleasure and I don't wanna spend five hours contributing to this project
|
||||
right now because I am tired.
|
||||
|
||||
I need newapkbuild but don't have it so I'll try to find the default template
|
||||
on-line or go off an existing thingy.
|
||||
|
||||
I found contrib/jq/template.py so I'll copy that.
|
||||
|
||||
pkgname = "unrar"
|
||||
|
||||
What's the pkgver?
|
||||
|
||||
$ cd /usr/local/src/unrar
|
||||
-sh: 5: cd: can't cd to /usr/local/src/unrar
|
||||
$ cd /usr/local/src
|
||||
$ ls
|
||||
$
|
||||
Connection to tebibyte.media closed.
|
||||
; # oops
|
||||
; cd /usr/local/src/unrar
|
||||
; cat version.hpp
|
||||
#define RARVER_MAJOR 6
|
||||
#define RARVER_MINOR 24
|
||||
#define RARVER_BETA 1
|
||||
#define RARVER_DAY 17
|
||||
#define RARVER_MONTH 9
|
||||
#define RARVER_YEAR 2023
|
||||
|
||||
I guess it doesn't matter because the download link says 6.12.2, so I'll just
|
||||
put that. Maybe I have a different version. I don't care.
|
||||
|
||||
pkgver = "6.12.2" #
|
||||
pkgrel = 0 # default
|
||||
build_style = "makefile"
|
||||
make_cmd = "gmake" # this probably doesn't matter, it worked with bmake too
|
||||
make_dir = "."
|
||||
hostmakedepends = [ "gmake" ]
|
||||
pkgdesc = "Extracts from RAR archives"
|
||||
maintainer = "trinity <trinity@trinity.moe>"
|
||||
# license is tricky. how does alpine do it?
|
||||
# checked. alpine does not do it, because unrar is non-free
|
||||
|
||||
What is this license, anyway?
|
||||
|
||||
; cat license.txt
|
||||
****** ***** ****** UnRAR - free utility for RAR archives
|
||||
** ** ** ** ** ** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
****** ******* ****** License for use and distribution of
|
||||
** ** ** ** ** ** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
** ** ** ** ** ** FREE portable version
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The source code of UnRAR utility is freeware. This means:
|
||||
|
||||
1. All copyrights to RAR and the utility UnRAR are exclusively
|
||||
owned by the author - Alexander Roshal.
|
||||
|
||||
2. UnRAR source code may be used in any software to handle
|
||||
RAR archives without limitations free of charge, but cannot be
|
||||
used to develop RAR (WinRAR) compatible archiver and to
|
||||
re-create RAR compression algorithm, which is proprietary.
|
||||
Distribution of modified UnRAR source code in separate form
|
||||
or as a part of other software is permitted, provided that
|
||||
full text of this paragraph, starting from "UnRAR source code"
|
||||
words, is included in license, or in documentation if license
|
||||
is not available, and in source code comments of resulting package.
|
||||
|
||||
3. The UnRAR utility may be freely distributed. It is allowed
|
||||
to distribute UnRAR inside of other software packages.
|
||||
|
||||
4. THE RAR ARCHIVER AND THE UnRAR UTILITY ARE DISTRIBUTED "AS IS".
|
||||
NO WARRANTY OF ANY KIND IS EXPRESSED OR IMPLIED. YOU USE AT
|
||||
YOUR OWN RISK. THE AUTHOR WILL NOT BE LIABLE FOR DATA LOSS,
|
||||
DAMAGES, LOSS OF PROFITS OR ANY OTHER KIND OF LOSS WHILE USING
|
||||
OR MISUSING THIS SOFTWARE.
|
||||
|
||||
5. Installing and using the UnRAR utility signifies acceptance of
|
||||
these terms and conditions of the license.
|
||||
|
||||
6. If you don't agree with terms of the license you must remove
|
||||
UnRAR files from your storage devices and cease to use the
|
||||
utility.
|
||||
|
||||
Thank you for your interest in RAR and UnRAR.
|
||||
|
||||
Alexander L. Roshal
|
||||
|
||||
Line omitted before signature because of how this blah is formatted.
|
||||
|
||||
This is fucking bullshit. I'm already in violation of clause 6 because I wish
|
||||
Alexandar L. Roshal to eat flaming death and be obliterated from this mortal
|
||||
plane but I won't be fucking anyone over legally by copying the code.
|
||||
|
||||
2021-10-20
|
||||
|
||||
[ 9:52 PM] trinity: bsdtar WORKS ON FUCKING RAR FILES?????
|
||||
[ 9:52 PM] trinity: 7z DID NOT DO THE JOB BUT bsdtar DID?
|
||||
[ 9:58 PM] [...]: that's shocking actually wtf
|
||||
[10:03 PM] trinity: bsdtar errors out too :(
|
||||
[10:03 PM] trinity: no unrar package for chimera
|
||||
[10:04 PM] trinity: not pkgsrcing it because 500 deps compiling on a raspberry
|
||||
pi
|
||||
[10:18 PM] trinity: figured out how to build unrar from source. NO DEPS!
|
||||
[10:18 PM] trinity: for nonfree software it sure is easy build
|
||||
[10:21 PM] [...]: why somebody would ever use a nonfree compressed archive
|
||||
format is beyond me
|
||||
[10:21 PM] [...]: .tar.gz is standard. .arc and .zpaq are fucking insane with
|
||||
compression ratios.
|
||||
|
||||
2021-10-21
|
||||
|
||||
[12:12 AM] trinity: i really dont understand use of rar
|
||||
[12:12 AM] trinity: as mainstream archives go 7z is a lot better
|
||||
[12:13 AM] [...]: yeah
|
||||
[12:13 AM] [...]: I see rar used a lot in piracy stuff and I'm not rlly sure
|
||||
what that's about
|
||||
[12:19 AM] [...]: wait i can use bsdtar for unrar
|
||||
[12:19 AM] [...]: pog
|
||||
[12:20 AM] trinity: unrar works better
|
||||
[12:20 AM] [...]: i dont have any way to unrar things atm because i
|
||||
uninstalled unrar for being nonfree
|
||||
[12:20 AM] trinity: unrar for nonfree software is not very bad. i oughtta just
|
||||
rewrite it in C
|
||||
[12:20 AM] [...]: someone has done that
|
||||
[12:21 AM] [...]: you could build on their work
|
||||
[12:21 AM] trinity: wouldnt that be free software
|
||||
[12:21 AM] trinity: fuck actually i dont like unrar's everything i should just
|
||||
make my own unrar based on the nonfree code
|
||||
[12:22 AM] trinity: license forbids this :(
|
||||
[12:22 AM] [...]: violating proprietary licenses is based
|
||||
[12:23 AM] [...]: unrar (super illegal edition!!)
|
||||
[12:23 AM] [...]: it doesnt currently work afaik. it works for older rar files
|
||||
[12:24 AM] trinity: is there much difference
|
||||
[12:26 AM] trinity: REing rar seems to not be that useful because soon everyone
|
||||
that uses it will be dead and everyone will be using
|
||||
something open
|
||||
[12:27 AM] [...]: idk
|
||||
[12:27 AM] [...]: rarverse engineering
|
||||
[12:28 AM] [...]: ill probably just write a wrapper for bsdtar that can be
|
||||
called on rar files
|
||||
[12:28 AM] [...]: rawrverse engineewing~ >.<
|
||||
[12:29 AM] trinity: because unrar, while proprietary, can be compiled with any
|
||||
C++ compiler and make tool and works with standard POSIX
|
||||
APIs, i don't think the ability to decompress will be
|
||||
threatened any time soon. best rebellion is just to decomp
|
||||
and recomp rar files into better formats
|
||||
[12:30 AM] trinity: did you know that rawr means i love you in dinosaur
|
||||
|
||||
AAAA I give up.
|
||||
|
||||
Chimera docs say very little about -doc packages, which should have the license
|
||||
file for the current software if the license is custom, which UnRAR's is. So
|
||||
license.txt should go in "$pkgdir"/usr/share/licenses/$pkgname/COPYING
|
||||
|
||||
Wait I get it. The cbuild will automagically add that license to the -doc
|
||||
package for me. Nevermind. So I just have to
|
||||
|
||||
license = "custom"
|
||||
|
||||
def post_install(self):
|
||||
self.install_license("license.txt")
|
||||
|
||||
url = "https://www.rarlab.com/rar_add.htm"
|
||||
source = f"https://www.rarlab.com/rar/unrarsrc-{pkgver}.tar.gz"
|
||||
|
||||
Okay, this would probably work, but I don't care to actually button this up and
|
||||
PR it so that's all it will be. Here's how it looks in my src/Makefile which
|
||||
works better for my uses:
|
||||
|
||||
# depends on
|
||||
# apk:g++
|
||||
$(PREFIX)/bin/unrar:
|
||||
git clone https://github.com/pmachapman/unrar.git "$(PREFIX)"/src/unrar
|
||||
$(MAKE) -C "$(PREFIX)"/src/unrar
|
||||
$(INSTALL) -Dm0755 "$(PREFIX)"/src/unrar/unrar "$(PREFIX)"/bin/unrar
|
||||
|
||||
To be honest, I copied the install(1) permission from somewhere else. Not sure
|
||||
if 0755 is the best config. But I don't care because FUCK UNRAR!!!!
|
||||
|
||||
|
||||
/blah/2023-10-14.html
|
||||
|
||||
: no filter
|
||||
|
Loading…
Reference in New Issue
Block a user