Skip to content

Commit 5d23ca3

Browse files
authored
continued expanding the build proceedures
1 parent 4bed017 commit 5d23ca3

1 file changed

Lines changed: 157 additions & 1 deletion

File tree

docs/NewPopplerRelease.md

Lines changed: 157 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,160 @@ We do this by renaming them:
7474

7575
Unfortunately, the six files you have just copied from the poppler sources,
7676
all `#include <config.h>`. These must be changed to `#include
77-
<poppler-config.h>`.
77+
<poppler-config.h>`. The actual `poppler-config.h` file will be created by
78+
the poppler build system when you (re)compile poppler. (Alternatively, it
79+
can be found in the `libpopper-private-dev` debian package if you are using
80+
the `libpoppler` package which comes with a Debian/Ubuntu release).
81+
82+
### Testing the build of pdf2htmlEX
83+
84+
Unfortunately, even if the six `Cairo*` files listed above have not changed,
85+
other files in the poppler libraries might have changed...
86+
87+
This means that the only way to know that the current pdf2htmlEX sources will
88+
compile with a given poppler version is to create an AWS EC2 instance
89+
and test compile/install both the newer version of poppler as well as the
90+
associated version of pdf2htmlEX.
91+
92+
To do this you can follow the instructions contained in the
93+
[building/Readme](../building/Readme.md).
94+
95+
Once you have an AWS EC2 instance running and configured with one of the
96+
[ec2-install-pdf2html-develop-XXX.yml](../building/ec2-install-pdf2html-develop-stg.yml)
97+
Ansible playbooks, log into your server via ssh and then type:
98+
99+
./dobuildPoppler
100+
./doinstallPoppler
101+
cd pdf2html
102+
./dobuild
103+
104+
And then look at the error messages... (easy eh?)
105+
106+
(**NOTE** before running one of the playbooks, you need to make sure
107+
that all of the correct poppler and pdf2htmlEX versions are correctly
108+
recorded in the playbook you plan to use.)
109+
110+
### Hacking the pdf2htmlEX sources
111+
112+
Once you have compilation error messages, you can hack the pdf2htmlEX
113+
source code on the AWS EC2 machine until you get it to compile...
114+
115+
### Getting the changes back to your working repository
116+
117+
While you do have a clone of your development pdf2htmlEX git repository,
118+
getting any changes back to your main working machine takes some care.
119+
Since the AWS EC2 test-compile machine is not very secure, you **do not**
120+
want to place your GitHub keys on the test-compile machine.
121+
122+
To transfer any changes I have made to the pdf2htmlEX source code
123+
I do a `git diff > patchFile` to create a patch file which I then
124+
pull back from the AWS EC2 machine to where my working repository is.
125+
I can then use the `splitpatch patchFile` tool to split the patchFile
126+
into patches for each individual file, review the changes and then
127+
apply them (if needed) to the files using the `patch` tool.
128+
129+
### Going round the loop
130+
131+
The process of getting stable changes to the pdf2htmlEX source code
132+
*will* take a number of iterations, many of which will include the
133+
creation of fresh new clean AWS EC2 machines with the current best
134+
working version of the pdf2htmlEX source code.
135+
136+
### Once you have compiling code
137+
138+
Once you have code that compiles it is now time to test pdf2htmlEX
139+
with some pdf's. To do this type:
140+
141+
cd
142+
pdf2htmlTest testrevelatornl
143+
pdf2htmlTest joyLoL
144+
145+
If these both work without errors, you can then view the resulting
146+
html using your local browser by typing:
147+
148+
openHTML0
149+
150+
on your local machine.
151+
152+
The `testrevelatornl.pdf` file is a very simple single paragraph of
153+
text. The `joyLoL.pdf` file is a very much more complex document with
154+
a table of contents, citation links to the bibliography, as well as
155+
a number of SVG based box diagrams (which include embedded text which
156+
*should* be selectable).
157+
158+
If this all works then you can progress to the creation of a Debian package.
159+
160+
If something fails.... you need to go around to loop a couple more times.
161+
162+
### Creating a Debian package.
163+
164+
Once you have working pdf2htmlEX code, you need to issue a pull request
165+
on the pdf2htmlEX/phd2htmlEX repository to get your code into the master
166+
repository.
167+
168+
Once your changes have been accepted, you need to build a Debian package.
169+
To do this you need to create an new fresh clean AWS EC2 machine with the
170+
source code from the *master* pdf2htmlEX repository.
171+
172+
To do this you can follow the instructions contained in the
173+
[building/Readme](../building/Readme.md).
174+
175+
Once you have an AWS EC2 instance running and configured with one of the
176+
[ec2-install-pdf2html-master.yml](../building/ec2-install-pdf2html-master.yml)
177+
Ansible playbooks, log into your server via ssh and then type:
178+
179+
./dobuildPoppler
180+
./doinstallPoppler
181+
cd pdf2html
182+
./build_dist.py
183+
184+
This will ask you to fill in the changeslog file using an editor of your
185+
choice. It will then go on and build the Debian package.
186+
187+
You can use the `getDeb0 <<debian package file name>>` command to pull
188+
the debian package archive back to your working machine putting it in the
189+
`tmp` directory. The `getDeb0` tool will also create `md4sum` and `sha256sum`
190+
files which contain `md5sum` and `sha256sum` fingerprints of the debian
191+
archive. (All in the `tmp` directory).
192+
193+
### Testing a debian archive
194+
195+
Once you have a debian archive you need to test *it* to make sure
196+
your installation instructions work as written (and there are no
197+
hidden dependencies). Agian, we need to do this on a fresh clean
198+
AWS EC2.
199+
200+
To do this you can follow the instructions contained in the
201+
[building/Readme](../building/Readme.md).
202+
203+
Once you have an AWS EC2 instance running and configured with one of the
204+
[ec2-install-pdf2html-testDeb.yml](../building/ec2-install-pdf2html-testDeb.yml)
205+
Ansible playbooks, log into your server once via ssh and then in a new terminal
206+
on your local machine type:
207+
208+
pushDeb0 <<path to your debian package>>
209+
210+
Then back on your new AWS EC2 machine type:
211+
212+
cd
213+
sudo apt install ./<<debian package name>>
214+
215+
(note the `./` is *required* for apt to install from a *local* package).
216+
217+
You can then test the pdf2htlmEX you have just installed using the commands:
218+
219+
cd
220+
pdf2htmlTest testrevelatornl
221+
pdf2htmlTest joyLoL
222+
223+
as above. As above you can use the:
224+
225+
openHTML0
226+
227+
on your local machine to view the resulting html files.
228+
229+
If all goes well you can then release the code....
230+
231+
### Releasing a new pdf2htmlEX version
232+
233+
TBD ;-(

0 commit comments

Comments
 (0)