Commit Graph

6 Commits

Author SHA1 Message Date
Xavier Roche
a7201b5d22 A relocated install still cannot find libhttrack on macOS (#1018)
* A relocated install still cannot find libhttrack on macOS

#964 gave httrack and htsserver a loader-relative rpath but opted Darwin
out: dyld expands @rpath only for a load path spelled that way, and
libtool stamps the dylib with the absolute libdir, so the entry would
never be consulted.

The id comes out of libtool's own archive_cmds template rather than from
LDFLAGS, so configure rewrites that template when the gate is on, and the
dylib links as @rpath/libhttrack.3.dylib from the start. The Darwin probe
now builds a library carrying such an id and runs a program that needs
it, so a dead LC_RPATH cannot pass for a live one; an unrecognised
template leaves the whole thing off.

Anything linked against libhttrack after this records the @rpath id and
must supply an rpath of its own. That is not an soname break, so
VERSION_INFO and the Debian package name are untouched.

Closes #978

Signed-off-by: Xavier Roche <roche@httrack.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Tighten the Darwin rpath gate and what 219 proves

Arm the install_name rewrite only when both libtool templates take it, so a
future divergence between archive_cmds and archive_expsym_cmds disarms the gate
rather than letting the -export-symbols path stamp an absolute id.

219 now reads the executables' LC_RPATH too, which catches an id moved to @rpath
while the binaries carry no entry answering it, and counts the libhttrack
dependency per binary instead of totalling across both.

Signed-off-by: Xavier Roche <roche@httrack.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>

* Ship a pkg-config file for libhttrack

The @rpath install_name is consumer-visible: anything linking against
libhttrack afterwards records @rpath/libhttrack.3.dylib and needs its own
LC_RPATH. libhttrack.pc is the standard pairing, handing out the include path
and, for a non-system libdir, -Wl,-rpath,${libdir}. The gate is
configure's existing hts_origin_sysdir, so an rpath into /usr/lib stays out.

222_pkgconfig-consumer.test stages an install, queries the staged .pc, then
builds and runs a consumer off it; the run is what proves the id and the rpath
resolve.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>

* Keep the pkg-config file out of the macOS bundle

An .app ships runtime, not development files, and the .pc names the staging
prefix the bundle check rejects.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>

* Trim the comments added with libhttrack.pc

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>

* Let 222 run against a sanitized libhttrack

The consumer is built from the .pc alone, so ASan's runtime is not first in its
library list; the interposer tests already turn that check off.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>

* Make libhttrack.pc link statically, and 222 able to see it

--static --libs handed out -lcrypto before -lssl, with -lz and -lzstd ahead
of the libcrypto that needs them, so an archive link left 76 symbols
undefined. Name the dependencies as pkg-config modules in Requires.private,
which orders them and carries any -L an out-of-the-way prefix needs, falling
back to the probed link line where a dependency ships no .pc. libhttrack-dev
gains the matching -dev dependencies: pkg-config fails outright on a module
whose own .pc is missing.

Test 222 could not see any of this. --define-variable overrides an
assignment the .pc already carries, so its relocation overwrote prefix,
libdir and includedir before anything was asserted: a hard-coded
libdir=${exec_prefix}/lib, which breaks Debian multiarch, passed unchanged.
It also only grepped --static --libs and then linked with the dynamic ones.
Assert the un-relocated values, and build and run a real static consumer.

The rpath the .pc hands out now answers to the same gates the executables'
own rpath respects, so --disable-origin-rpath and an archive-only build stay
rpath-free; 196 covers all six cases. On Darwin 222 skips where configure
left the dylib an absolute install name, and 219 skips on an unset
abs_top_builddir rather than erroring, as 222 already did.

Signed-off-by: Xavier Roche <xroche@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>

* Trim test 222 to the assertions that carry a mutant

The pkg-config consumer test had grown to 225 lines, much of it belt and
braces around checks that already fire elsewhere: the -I/-L extraction and
its stage-relocation loop, the -lz grep on --static --libs, and the rpath
gate check that test 196 now reads straight out of the generated .pc in all
six of its configure cases.

Each of the eight mutants the test was written for still dies: a wrong
libdir, includedir or prefix in the .pc, a multiarch build hard-coding
libdir=${exec_prefix}/lib, the rpath flag dropped from Libs:, the old
Libs.private order with no Requires.private, Cflags one level too high, and
a .pc generated but never installed. The dropped rpath is now caught by the
run itself, since the consumer is launched with LD_LIBRARY_PATH unset
wherever the .pc promises an rpath.

Signed-off-by: Xavier Roche <xroche@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>

---------

Signed-off-by: Xavier Roche <roche@httrack.com>
Signed-off-by: Xavier Roche <xroche@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 10:25:32 +00:00
Xavier Roche
71ab3574ef Remove the obsolete Java-applet parser and dead SWF module remnants (#552)
* Remove the obsolete Java-applet .class parser and dead SWF vestiges

Java applets stopped running in every mainstream browser years ago (NPAPI
dropped by Chrome in 2015 and Firefox in 2017; the JDK browser plugin gone
since JDK 11), so htsjava -- a hand-rolled parser of hostile .class bytecode
fetched off the network -- chased dependencies no live site serves while
carrying real attack surface for no functional gain. The SWF module was
already gone; only vestiges remained (a dead libhtsswf.so.1 dlopen entry and
help-text examples).

htsjava was a dlopen plugin, never linked into libhttrack, so its removal
leaves libhttrack's ABI untouched: libhttrack.so.3 is unchanged and the
libhttrack3/-dev packages just stop shipping libhtsjava.so.3*. That is a
plain file drop dpkg removes on upgrade -- no package rename, no
Replaces/Breaks, and nothing ever linked the library (it was dlopened), so
there are no reverse dependencies. The parsejava/-j option stays; it also
gates JavaScript parsing.

Drops the plugin sources, the build/config/vcproj wiring, the java self-test
and its two engine tests, and the now-unused hts_count_fits helper (whose
only caller was the plugin), and regenerates the man page. The <applet> URL
rewriting in the HTML parser and the .class codebase bookkeeping are left
intact, so applet pages are still mirrored as plain files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>

* Scrub the removed java/swf modules from the shipped HTML docs

Follow-up to the htsjava/SWF removal: the pre-generated docs in html/ (shipped
in httrack-doc) still named the gone modules. Update the two stale --help
mirrors in httrack.man.html by hand (a full groff regen would rewrite the whole
file under a newer groff) and drop the htsjava.c plugin-example reference from
plug.html.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>

* Finish scrubbing the java-class docs across the guides and man source

The -j option still exists (it drives JavaScript parsing), so every "parse
Java Classes" summary in the HTML guides becomes "parse scripts", and the
obsolete .class-parsing descriptions and java-applet troubleshooting entries
are reworded to drop the removed capability. The "Some java classes may not
find..." engine-limit line is dropped at its source (README, from which
makeman.sh regenerates the man LIMITS section), and httrack.1 regenerated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>

---------

Signed-off-by: Xavier Roche <roche@httrack.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 18:09:56 +02:00
Xavier Roche
b1a98a7f16 Fixed and modernize lintian handling 2023-01-14 17:21:57 +01:00
Xavier Roche
c53657789b Set debian/compat to 10 (multiarch) 2023-01-14 15:12:07 +01:00
Xavier Roche
d4c81f4e85 Cleanup in debian/rules 2013-06-02 12:05:52 +00:00
Xavier Roche
ae1ea4cb8b Debian repository 2012-03-19 13:11:53 +00:00