File: packaging-tutorial.es.tex

package info (click to toggle)
packaging-tutorial 0.30
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,532 kB
  • sloc: makefile: 31; sh: 4
file content (2177 lines) | stat: -rw-r--r-- 78,614 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
% This file was generated with po4a. Translate the source file.
%
\documentclass[10pt,final]{beamer}
\mode<presentation> \usetheme{debian}

\usepackage{debiantutorial.es} \usepackage[spanish]{babel}

\hypersetup{bookmarks}
\title{Guía de creación de paquetes Debian}
\author[]{Lucas Nussbaum\\{\small\texttt{packaging-tutorial@packages.debian.org}}}

\date{\footnotesize version 0.29 -- 2021-11-03} 

\begin{document}


\frame{\titlepage}

\begin{frame}{Acerca de esta guía}
  \begin{itemize}
  \item Objetivo: \textbf{ofrecer el conocimiento esencial para la creación de
paquetes de Debian}
    \begin{itemize}
      \hbr
    \item Modificar paquetes existentes
      \hbr
    \item Crear sus propios paquetes
	    \hbr
    \item Comunicarse con la comunidad de Debian
      \hbr
    \item Convertirse en un usuario avanzado de Debian
    \end{itemize}
    \br
  \item Cubre los aspectos más importantes, pero no es completo
    \begin{itemize}
    \item Tendrá que leer más documentación
    \end{itemize}
    \br
  \item Most of the content also applies to Debian derivative distributions
    \begin{itemize}
      \hbr
    \item Esto incluye Ubuntu
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}{Esquema}
  \tableofcontents[hideallsubsections]
\end{frame}

\section{Introducción}

\subsection{Debian}

\begin{frame}{Debian}
	\begin{itemize}
		\item \textbf{Distribución GNU/Linux}
			\br
		\item La primera distribución mayoritaria desarrollada «de forma abierta, con el
espíritu de GNU»
			\br
		\item \textbf{No comercial}, creado de forma colaborativa por más de 1.000
voluntarios
			\br
		\item Tres características principales:
			\begin{itemize}
				\item \textbf{Calidad} -- cultura de excelencia técnica\\ {\small\sl Publicamos
cuando está listo}
					\hbr
				\item \textbf{Libertad} -- los desarrolladores y los usuarios se adhieren al
\textsl{Contrato Social}\\ Fomentando la cultura de Software libre desde
1993
					\hbr
				\item \textbf{Independencia} -- ninguna (única) compañía controla Debian\\ Proceso
abierto de toma de decisiones (\textsl{voluntariedad} + \textsl{democracia})
			\end{itemize}
                        \br
                \item \textbf{Amateur} en el mejor sentido: creado por el placer de ello
	\end{itemize}
\end{frame}

\subsection{Paquetes Debian}
\begin{frame}{Paquetes Debian}
\begin{itemize}
\item Ficheros \textbf{.deb} (paquetes binarios)
	\br
\item Una potente y cómoda forma de distribuir software a los usuarios
	\br
\item One of the two most common package formats (with RPM)
	\br
\item Universal:
	\begin{itemize}
		\item 30.000 paquetes binarios en Debian\\ $\rightarrow$ La mayoría del software
libre está empaquetado para Debian
			\hbr
		\item Con 12 adaptaciones (arquitecturas), incluyendo dos distintas a Linux (Hurd
y KFreeBSD)
			\hbr
		\item Also used by 120 Debian derivative distributions
	\end{itemize}
\end{itemize}
\end{frame}


\subsection{El formato de paquete deb}

\begin{frame}[fragile=singleslide]{El formato de paquete deb}
  \begin{itemize}
  \item Fichero \texttt{.deb}: un archivo \texttt{ar}
    \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
$ ar tv wget_1.12-2.1_i386.deb
rw-r--r-- 0/0      4 Sep  5 15:43 2010 debian-binary
rw-r--r-- 0/0   2403 Sep  5 15:43 2010 control.tar.gz
rw-r--r-- 0/0 751613 Sep  5 15:43 2010 data.tar.gz
    \end{lstlisting} \begin{itemize}
    \item \texttt{debian-binary}: versión del formato de fichero «deb»,
\texttt{"2.0\textbackslash{}n"}
    \item \texttt{control.tar.gz}: Metadatos del paquete\\ {\small
\texttt{\textbf{control}, sumas de control md5, (pre|post)(rm|inst),
accionadores, bibliotecas compartidas}, \ldots}
    \item \texttt{data.tar.gz}: Ficheros de datos del paquete
    \end{itemize}
    \br
  \item Puede crear sus propios ficheros \texttt{.deb} manualmente\\ {\footnotesize
\url{http://tldp.org/HOWTO/html\_single/Debian-Binary-Package-Building-HOWTO/}}
    \br
  \item No obstante, la mayoría de las personas no lo hacen de esta forma
  \end{itemize}
  \br
  \centerline{\textbf{En esta guía: crear paquetes Debian, con el estilo Debian}}
\end{frame}

\subsection{Herramientas necesarias}
\begin{frame}{Herramientas necesarias}
  \begin{itemize}
  \item Un sistema Debian (o Ubuntu) con acceso de usuario «root»
    \br
  \item Algunos paquetes:
    \begin{itemize}
    \item \textbf{build-essential}: has dependencies on the packages that will be
assumed to be available on the developer's machine (no need to specify them
in the \texttt{Build-Depends:} control field of your package)
      \begin{itemize}
      \item también depende de \textbf{dpkg-dev}, que contiene las herramientas
específicas de Debian para la creación de paquetes
      \end{itemize}
      \hbr
    \item \textbf{devscripts}: contiene scripts útiles a los responsables de paquetes
de Debian
    \end{itemize}
  \end{itemize}

  \br
  En el futuro se mencionarán otras herramientas, como textbf{debhelper},
\textbf{cdbs}, \textbf{quilt}, \textbf{pbuilder}, \textbf{sbuild},
\textbf{lintian}, \textbf{svn-buildpackage}, \textbf{git-buildpackage},
\ldots\\ Instálelos a medida que los necesite
\end{frame}

\subsection{Etapas generales en la creación de paquetes}
\begin{frame}{Etapas generales en la creación de paquetes}
  \begin{center}
    \begin{tikzpicture}[
      node1/.style={shape=rectangle,draw=rouge,fill=debianbackgroundblue,thick},
      arr/.style={very thick}, command/.style={text=rouge,font=\ttfamily}, ]
      
      \node[node1] (www) at (0, 0) {Red}; \node[node1] (us) at (2.5, 0) {Código
fuente original}; \node[node1] (da) at (-2.5, 0) {Réplica de Debian};
\node[node1] (sp) at (0, -2) {Paquete fuente}; \draw[arr,<-,dashed,thick]
(sp) -- (2.5,-2) node[right=0cm,text width=2.98cm,text
centered,font=\small\sl] {Donde se realiza casi toda la parte manual};
\node[node1] (bin) at (0, -4) {Uno o varios paquetes binarios};
\draw[arr,<-,dashed,thick] (bin) -- (3.5,-4) node[right,text
centered,font=\small\ttfamily\sl] {.deb\normalfont}; \draw[arr,->] (us) --
(sp) node[pos=0.5,right,command] {dh\_make}; \draw[arr,->] (da) -- (sp)
node[pos=0.5,left,command] {apt-get source}; \draw[arr,->] (www) -- (sp)
node[pos=0.5,left,command] {dget}; \draw[arr,->] (sp) -- (bin)
node[pos=0.5,right,text width=6cm] {\textttc{debuild} (Construir y comprobar
con \textttc{lintian}) o \textttc{dpkg-buildpackage}}; \draw[arr,->] (bin)
-- (1,-6) node[pos=0.5,right] {Instalación (\textttc{debi})};
\draw[transparent] (bin) -- (-1,-6) node[pos=0.5,left,opaque] {Envío del
paquete (\textttc{dput})}; \draw[arr,->,rounded corners] (bin) -- (-1,-6) --
(-4.5,-6) -- (-4.5,0) -- (da); \useasboundingbox (-4,-6) rectangle (6,0); \end{tikzpicture}
  \end{center}
\end{frame}

\subsection{Reconstruir dash}
\begin{frame}{Ejemplo: reconstruir dash}
\begin{enumerate}
\item Install packages needed to build dash, and devscripts\\ {\texttt{sudo
apt-get build-dep dash}\\ (requires \texttt{deb-src} lines in
\texttt{/etc/apt/sources.list})}\\ {\texttt{sudo apt-get install
-{}-no-install-recommends devscripts fakeroot}}
  \hbr
\item Cree un directorio de trabajo y entre:\\ \texttt{mkdir /tmp/debian-tutorial
; cd /tmp/debian-tutorial}
  \hbr
\item Obtenga el paquete de fuentes de \texttt{dash}\\ \texttt{apt-get source
dash}\\ {\small (Requiere las líneas \texttt{deb-src} en
\texttt{/etc/apt/sources.list})}
  \hbr
\item Construya el paquete\\ {\texttt{cd dash-*\\ debuild -us -uc}}
~~~(\texttt{-us -uc} desactiva el firmado de paquetes con GPG)

  \hbr
\item Compruebe el funcionamiento
	\begin{itemize}
		\item  Hay algunos ficheros \texttt{.deb} nuevos en el directorio superior
	\end{itemize}
    \hbr
\item Compruebe el directorio \texttt{debian/}
	\begin{itemize}
		\item Aquí se realizan las tareas de empaquetado
	\end{itemize}
\end{enumerate}
\end{frame}

\section{Creación de paquetes fuente}
\subsection{Nociones básicas de paquetes fuente}
\begin{frame}{Paquete fuente}
  \begin{itemize}
  \item Un paquete fuente puede generar varios paquetes binarios\\ {\small Por
ejemplo, las fuentes de \texttt{\bfseries libtar} generan los paquetes
binarios \texttt{\bfseries libtar0} y \texttt{\bfseries libtar-dev}} \hbr
  \item Dos tipos de paquete: (si duda, utilice el formato no nativo)
    \begin{itemize}
      \small
    \item Paquetes nativos: habitualmente es software específico de Debian
(\textsl{dpkg}, \textsl{apt})
    \item Paquetes no nativos: software desarrollado fuera de Debian
    \end{itemize}
    \hbr
  \item Fichero principal: \texttt{.dsc} (metadatos)
    \hbr
  \item Otros ficheros que dependen de la versión del formato de fuentes
    \begin{itemize}
    \item 1.0 or 3.0 (native): \texttt{package\_version.tar.gz}
      \hbr
    \item 1.0 (non-native):
      \begin{itemize}
      \item \texttt{pkg\_ver.orig.tar.gz} : Fuente original de software
      \item \texttt{pkg\_debver.diff.gz} : Parche para añadir cambios específicos de
Debian
      \end{itemize}
      \hbr
    \item 3.0 (quilt):
      \begin{itemize}
      \item \texttt{pkg\_ver.orig.tar.gz} : Fuente original de software
      \item \texttt{pkg\_debver.debian.tar.gz} : Archivo tar con los cambios de Debian
      \end{itemize}
    \end{itemize}
  \end{itemize}
  \hbr
  (Para detalles precisos consulte \texttt{dpkg-source(1)})
\end{frame}

\begin{frame}[fragile=singleslide]{Ejemplo de paquete fuente (wget\_1.12-2.1.dsc)}
  \begin{lstlisting}[basicstyle=\ttfamily\small]
Format: 3.0 (quilt)
Source: wget
Binary: wget
Architecture: any
Version: 1.12-2.1
Maintainer: Noel Kothe <noel@debian.org>
Homepage: http://www.gnu.org/software/wget/
Standards-Version: 3.8.4
Build-Depends: debhelper (>> 5.0.0), gettext, texinfo,
 libssl-dev (>= 0.9.8), dpatch, info2man
Checksums-Sha1: 
 50d4ed2441e67[..]1ee0e94248 2464747 wget_1.12.orig.tar.gz
 d4c1c8bbe431d[..]dd7cef3611 48308 wget_1.12-2.1.debian.tar.gz
Checksums-Sha256: 
 7578ed0974e12[..]dcba65b572 2464747 wget_1.12.orig.tar.gz
 1e9b0c4c00eae[..]89c402ad78 48308 wget_1.12-2.1.debian.tar.gz
Files: 
 141461b9c04e4[..]9d1f2abf83 2464747 wget_1.12.orig.tar.gz
 e93123c934e3c[..]2f380278c2 48308 wget_1.12-2.1.debian.tar.gz
\end{lstlisting}
\end{frame}

\subsection{Obtener paquetes fuente}
\begin{frame}{Obtener un paquete fuente existente}
  \begin{itemize}
  \item Del archivo de Debian:
    \begin{itemize}
    \item \texttt{apt-get source \textsl{paquete}}
    \item \texttt{apt-get source \textsl{paquete=versión}}
    \item \texttt{apt-get source \textsl{paquete/publicación}}
    \end{itemize}
    (Se requieren líneas \texttt{deb-src} en \texttt{sources.list})
    \br
  \item De Internet:
    \begin{itemize}
    \item \texttt{dget \textsl{url-to.dsc}}
    \item \texttt{dget
http://snapshot.debian.org/archive/debian-archive/\\20090802T004153Z/debian/dists/bo/main/source/web/\\ 
wget\_1.4.4-6.dsc}\\ (\href{http://snapshot.debian.org/}{\ttfamily
snapshot.d.o} proporciona todos los paquetes de Debian desde 2005)
    \end{itemize}
    \br
  \item Del sistema de control de versiones (declarado):
    \begin{itemize}
    \item \texttt{debcheckout \textsl{paquete}}
    \end{itemize}
    \br
  \item Cuando finalice la descarga, extraiga los contenidos con \texttt{dpkg-source
-x \textsl{file.dsc}}
  \end{itemize}
\end{frame}

\subsection{Creación de un paquete fuente básico}
\begin{frame}{Creación de un paquete fuente básico}
  \begin{itemize}
  \item Descargue las fuentes del desarrollador original \\ (\textsl{fuente
original} = el que se obtiene de los desarrolladores originales del
software)
    \hbr
  \item Renómbrelo a
\texttt{<\textsl{paquete\_fuente}>\_<\textsl{versión\_original}>.orig.tar.gz}\\ 
(ejemplo: \texttt{simgrid\_3.6.orig.tar.gz})
    \hbr
  \item Abra el archivo tar
    \hbr
  \item Rename the directory to
\texttt{<\textsl{source\_package}>-<\textsl{upstream\_version}>}\\ (example:
\texttt{simgrid-3.6})
    \hbr
  \item \texttt{cd \texttt{<\textsl{source\_package}>-<\textsl{upstream\_version}>}
\&\& dh\_make}\\ (from the \textbf{dh-make} package)
    \hbr
  \item Existen alternativas a \texttt{dh\_make} para grupos específicos de paquete:
\textbf{dh-make-perl}, \textbf{dh-make-php}, \ldots \hbr
  \item Se crea el directorio \texttt{debian/}, que contiene muchos ficheros
  \end{itemize}
\end{frame}

\subsection{Ficheros en «debian/»}
\begin{frame}{Ficheros en «debian/»}
  Todas las tareas de empaquetado se deben realizar modificando ficheros en
\texttt{debian/}
  \hbr
  \begin{itemize}
  \item Ficheros principales:
    \begin{itemize}
    \item \textbf{control} -- Metadatos del paquete (dependencias, etc)
    \item \textbf{rules} -- Especifica cómo construir el paquete
    \item \textbf{copyright} -- Información de derechos de autor del paquete
    \item \textbf{changelog} -- Registro histórico del paquete de Debian
    \end{itemize}
    \hbr
  \item Otros ficheros:
    \begin{itemize}
    \item compat
    \item watch
    \item dh\_install* targets\\ {\small *.dirs, *.docs, *.manpages, \ldots}
    \item scripts de desarrollador\\ {\small *.postinst, *.prerm, \ldots}
    \item source/format
    \item patches/ -- si tiene que modificar las fuentes del desarrollador original
    \end{itemize}
    \hbr
  \item Varios ficheros utilizan un formato basado en RFC 822 (cabeceras de correo
electrónico)
  \end{itemize}
\end{frame}

\begin{frame}[fragile=singleslide]{debian/changelog}
  \begin{itemize}
  \item Lista los cambios del paquete Debian
  \item Muestra la versión actual del paquete
  \begin{center}
    \begin{tikzpicture}
	    \draw (0,0) node[above right] {\large 1.2.1.1-5}; \draw
[decorate,decoration={brace}] (2,0) -- (1.45,0) node[at start,below,text
width=1.6cm,text centered] {\small Revisión de Debian}; \draw
[decorate,decoration={brace}] (1.4,0) -- (0,0) node[midway,below,text
width=1.6cm,text centered] { \small Versión de la fuente original};
\end{tikzpicture}
\end{center}


	  \item Edición manual o con \textttc{dch}
  \begin{itemize}
	  \item Cree una entrada en el fichero «changelog» para una nueva publicación:
\textttc{dch -i}
  \end{itemize}
  \item Formato especial para cerrar de forma automática informes de fallo de Debian
o Ubuntu\\ Debian: \texttt{Closes:~\#595268}; Ubuntu: \texttt{LP:~\#616929}
  \item Se instala como \texttt{/usr/share/doc/\textit{package}/changelog.Debian.gz}
  \end{itemize}
  \seprule
  \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
mpich2 (1.2.1.1-5) unstable; urgency=low

  * Use /usr/bin/python instead of /usr/bin/python2.5. Allow
    to drop dependency on python2.5.  Closes: #595268
  * Make /usr/bin/mpdroot setuid. This is the default after
    the installation of mpich2 from source, too. LP: #616929
    + Add corresponding lintian override.

 -- Lucas Nussbaum <lucas@debian.org>  Wed, 15 Sep 2010 18:13:44 +0200
\end{lstlisting}
\end{frame}

\begin{frame}[fragile=singleslide]{debian/control}
  \hbr
  \begin{itemize}
  \item Metadatos del paquete
    \begin{itemize}
    \item Para el mismo paquete fuente
    \item Para cada paquete binario construido a partir de estas fuentes
    \end{itemize}
    \hbr
  \item Nombre del paquete, sección, prioridad, desarrollador, aquellos con permiso
para subir una nueva versión del paquete, dependencias de construcción,
dependencias, descripción, página web, \ldots \hbr
  \item Documentation: Debian Policy chapter 5\\ 
\url{https://www.debian.org/doc/debian-policy/ch-controlfields}
  \end{itemize}
  \seprule
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
Source: wget
Section: web
Priority: important
Maintainer: Noel Kothe <noel@debian.org>
Build-Depends: debhelper (>> 5.0.0), gettext, texinfo,
 libssl-dev (>= 0.9.8), dpatch, info2man
Standards-Version: 3.8.4
Homepage: http://www.gnu.org/software/wget/

Package: wget
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: retrieves files from the web
 Wget is a network utility to retrieve files from the Web
\end{lstlisting}
\end{frame}

\begin{frame}{Arquitectura: all o any (todas o cualquiera)}
  Dos tipos de paquete binario:
  \hbr
  \begin{itemize}
  \item Paquetes con diferente contenido para cada arquitectura de Debian
    \begin{itemize}
    \item Ejemplo: programa escrito en C
    \item \texttt{Architecture:\ any} en \texttt{debian/control}
      \begin{itemize}
      \item O, si solo funciona con un subconjunto de arquitecturas:\\ 
\texttt{Architecture:\ amd64 i386 ia64 hurd-i386}
      \end{itemize}
    \item buildd.debian.org: Construye el paquete para todas las otras arquitecturas
por Ud. al enviar el paquete
    \item Creado como
\texttt{\textsl{paquete}\_\textsl{versión}\_\textsl{arquitectura}.deb}
    \end{itemize}
    \br
  \item Paquetes con el mismo contenido para todas las arquitecturas
    \begin{itemize}
    \item Ejemplo: Biblioteca de Perl
    \item \texttt{Architecture:\ all} en \texttt{debian/control}
    \item Creado como \texttt{\textsl{paquete}\_\textsl{versión}\_\textbf{all}.deb}
    \end{itemize}
  \end{itemize}
  \br
  Un paquete fuente puede generar una combinación de paquetes binarios con
\texttt{Architecture:\ any} y \texttt{Architecture:\ all}
\end{frame}

\begin{frame}[fragile=singleslide]{debian/rules}
  \hbr
  \begin{itemize}
  \item Makefile
    \br
  \item Interfaz utilizada para construir paquetes Debian
    \br
  \item Documented in Debian Policy, chapter 4.8\\ {\small
\url{https://www.debian.org/doc/debian-policy/ch-source\#s-debianrules}}
    \br
  \item Required targets:
    \begin{itemize}
    \item \texttt{build, build-arch, build-indep}: Debe realizar toda la configuración
y compilación
      \hbr
    \item \texttt{binary, binary-arch, binary-indep}: Construye los paquetes binarios
      \begin{itemize}
      \item \texttt{dpkg-buildpackage} invoca \texttt{binary} para construir todos los
paquetes, o \texttt{binary-arch} para construir solo los paquetes con
\texttt{Architecture:~any}
      \end{itemize}
      \hbr
    \item \texttt{clean}: Limpia el directorio de fuentes
    \end{itemize}
  \end{itemize}
\end{frame}

\subsection{Asistentes de creación de paquetes}
\begin{frame}{Asistentes de creación de paquetes -- debhelper}
  \begin{itemize}
  \item Puede editar código de intérprete de órdenes directamente en
\texttt{debian/rules}
  \item Práctica recomendada (utilizada con la mayoría de paquetes): utilice un
\textsl{Asistente de creación de paquetes}
  \item El más popular: \textbf{debhelper} (utilizado por el 98\% de los paquetes)
  \item Objetivos:
    \begin{itemize}
    \item Incluir las tareas más comunes en herramientas estándar utilizadas por todos
los paquetes
    \item Arreglar algunos fallos de empaquetado una sola vez para todos los paquetes
    \end{itemize}{\footnotesize dh\_installdirs, dh\_installchangelogs, dh\_installdocs,
dh\_install, dh\_installdebconf, dh\_installinit, dh\_link, dh\_strip,
dh\_compress, dh\_fixperms, dh\_perl, dh\_makeshlibs, dh\_installdeb,
dh\_shlibdeps, dh\_gencontrol, dh\_md5sums, dh\_builddeb, \ldots}
    \begin{itemize}
    \item Se invoca desde \texttt{debian/rules}
    \item Configurable utilizando parámetros de órdenes o ficheros en \texttt{debian/}
    \end{itemize}{\footnotesize \ttfamily \textsl{package}.docs, \textsl{package}.examples,
\textsl{package}.install, \textsl{package}.manpages, \ldots} \hbr
  \item Otros asistentes para conjuntos específicos de paquetes:
\textbf{python-support}, \textbf{dh\_ocaml}, \ldots \hbr
  \item \texttt{debian/compat}: Debhelper compatibility version
	  \begin{itemize}
		  \item Defines precise behaviour of dh\_*
		  \item New syntax: \texttt{Build-Depends: debhelper-compat (= 13)}
	  \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}[fragile=singleslide]{debian/rules con debhelper (1/2)}
  \begin{lstlisting}[basicstyle=\ttfamily\footnotesize,escapeinside=\{\}]
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

build: 
        $(MAKE)
        #docbook-to-man debian/packagename.sgml > packagename.1

clean: 
        dh_testdir
        dh_testroot
        rm -f build-stamp configure-stamp
        $(MAKE) clean
        dh_clean 

install: build
        dh_testdir
        dh_testroot
        dh_clean -k 
        dh_installdirs
        # Add here commands to install the package into debian/packagename.
        $(MAKE) DESTDIR=$(CURDIR)/debian/packagename install
\end{lstlisting}
\end{frame}

\begin{frame}[fragile=singleslide]{debian/rules con debhelper (2/2)}
  \begin{lstlisting}[basicstyle=\ttfamily\footnotesize,escapeinside=\{\}]

# Build architecture-independent files here.
binary-indep: build install

# Build architecture-dependent files here.
binary-arch: build install
        dh_testdir
        dh_testroot
        dh_installchangelogs 
        dh_installdocs
        dh_installexamples
        dh_install
        dh_installman
        dh_link
        dh_strip
        dh_compress
        dh_fixperms
        dh_installdeb
        dh_shlibdeps
        dh_gencontrol
        dh_md5sums
        dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
\end{lstlisting}
\end{frame}

\begin{frame}[fragile=singleslide]{CDBS}
  \hbr
  \begin{itemize}
  \item Con debhelper, aún hay redundancias entre paquetes
    \hbr
  \item Asistentes de segundo nivel que permiten dividir funcionalidades comunes
    \begin{itemize}
    \item E.g. building with \texttt{./configure \&\& make \&\& make install} or CMake
    \end{itemize}
    \hbr
  \item CDBS:
    \begin{itemize}
    \item Introducido en 2005, basado en «magia» avanzada de \textsl{GNU make}
    \item Documentación: \texttt{/usr/share/doc/cdbs/}
    \item Compatibilidad con Perl, Python, Ruby, GNOME, KDE, Java, Haskell, \ldots
    \item Algunas personas lo odian:
      \begin{itemize}
      \item A veces es difícil personalizar la construcción del paquete \\ "\textsl{un
conjunto complejo de ficheros «Makefile» y variables de entorno}"
      \item Más lento que utilizar solo debhelper (varias invocaciones inútiles a
\texttt{dh\_*})
      \end{itemize}
    \end{itemize}
  \end{itemize}
  \seprule
      \begin{lstlisting}[basicstyle=\ttfamily\footnotesize,escapeinside=\{\}]
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

# add an action after the build
build/mypackage::
    /bin/bash debian/scripts/foo.sh
      \end{lstlisting}
\end{frame}

\begin{frame}[fragile=singleslide]{Dh (alias Debhelper 7, o dh7)}
  \begin{itemize}
  \item Introducido en 2008 como alternativa \textsl{asesina de CDBS}
    \hbr
  \item Orden \textbf{dh} que invoca \texttt{dh\_*}
    \hbr
  \item Sencillos ficheros \textsl{debian/rules}, que solo enumeran las
sustituciones
    \hbr
  \item Más fácil de personalizar que CDBS
    \hbr
  \item Documentación:páginas de manual (\texttt{debhelper(7)}, \texttt{dh(1)}) +
presentaciones de la conferencia durante DebConf9\\ 
\url{http://kitenet.net/~joey/talks/debhelper/debhelper-slides.pdf}
  \end{itemize}
  \seprule
    \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
#!/usr/bin/make -f
%:
    dh $@

override_dh_auto_configure:
     dh_auto_configure -- --with-kitchen-sink

override_dh_auto_build:
     make world

    \end{lstlisting}
\end{frame}

\begin{frame}{debhelper clásico vs CDBS vs dh}
  \hbr
  \begin{itemize}
  \item Mind shares:\\ Classic debhelper: 15\% \hskip 1em CDBS: 15\% \hskip 1em dh:
68\%
    \hbr
  \item ¿Cuál debería aprender?
    \begin{itemize}
    \item Puede que un poco de cada uno
    \item Necesita conocer debhelper para utilizar dh y CDBS
    \item Puede que tenga que modificar paquetes CDBS
    \end{itemize}
    \hbr
  \item ¿Cuál debería utilizar con un paquete nuevo?
    \begin{itemize}
	    \item \textbf{dh} (la única solución con una aceptación creciente)
	    \item See \url{https://trends.debian.net/\#build-systems}
    \end{itemize}
  \end{itemize}
  
  \hbr


\end{frame}

\section{Construir y comprobar paquetes}
\subsection{Construir paquetes}
\begin{frame}{Construir paquetes}
  \begin{itemize}
  \item \textttc{apt-get build-dep mypackage}\\ Installs the
\textsl{build-dependencies} (for a package already in Debian)\\ Or
\textttc{mk-build-deps -ir} (for a package not uploaded yet)
    
    \br
  \item \textttc{debuild}: construcción, comprobación con \texttt{lintian}, firma
con GPG
    \br
  \item También se puede invocar \textttc{dpkg-buildpackage} directamente
    \begin{itemize}
    \item Habitualmente con \texttt{dpkg-buildpackage -us -uc}
    \end{itemize}
    \br
  \item Se recomienda construir paquetes en un entorno mínimo y limpio
    \begin{itemize}
    \item \textttc{pbuilder} -- Asistente de construcción de paquetes en una
\textsl{«jaula» chroot}\\ Buena documentación:
\url{https://wiki.ubuntu.com/PbuilderHowto}\\ (optimización:
\textttc{cowbuilder} \textttc{ccache} \textttc{distcc})
      \hbr
    \item \textttc{schroot} y \textttc{sbuild}: Utilizados por los servicios de
construcción de Debian\\ (no es tan sencillo como \texttt{pbuilder}, pero es
compatible con datos LVM\\ Consulte:
\url{https://help.ubuntu.com/community/SbuildLVMHowto} )
    \end{itemize}
    \br
  \item Genera ficheros \texttt{.deb} y un fichero \texttt{.changes}
    \begin{itemize}
    \item \texttt{.changes}: Describe lo construido; se emplea para enviar el paquete
    \end{itemize}
  \end{itemize}
\end{frame}
\subsection{Instalar y comprobar paquetes}
\begin{frame}{Instalar y comprobar paquetes}
  \begin{itemize}
  \item Instalación local del paquete: \textttc{debi} (emplea \texttt{.changes} para
saber qué instalar) \br
  \item Muestra el contenido del paquete: \texttt{{\color{rouge}debc}
../mi-paquete<TAB>.changes} \br
  \item Compare el paquete con una versión anterior:\\ 
\texttt{{\color{rouge}debdiff} ../mi-paquete\_1\_*.changes
../mi-paquete\_2\_*.changes}\\ o para comparar las fuentes:\\ 
\texttt{{\color{rouge}debdiff} ../mi-paquete\_1\_*.dsc
../mi-paquete\_2\_*.dsc}\\
    \br
  \item Check the package with \texttt{lintian} (static analyzer):\\ 
\texttt{{\color{rouge}lintian} ../mypackage<TAB>.changes}\\ \texttt{lintian
-i}: gives more information about the errors \\ \texttt{lintian -EviIL
+pedantic}: shows more problems\br
  \item Envíe el paquete a (\textttc{dput}) (requiere configuración) \br
  \item Manage a private Debian archive with \textttc{reprepro} or \textttc{aptly}\\ 
Documentation: \url{https://wiki.debian.org/HowToSetupADebianRepository}
  \end{itemize}
\end{frame}
\section{Ejercicio práctico 1: modificar el paquete grep}
\begin{frame}{Ejercicio práctico 1: modificar el paquete grep}
  \begin{enumerate}
  \item Go to \url{http://ftp.debian.org/debian/pool/main/g/grep/} and download
version 2.12-2 of the package
    \begin{itemize}
		   \item Si el paquete no se desempaqueta de forma automática, utilice
\texttt{dpkg-source~-x~grep\_*.dsc}
    \end{itemize}

  \item Consulte los ficheros en \texttt{debian/}.
    \begin{itemize}
    \item 		¿Cuántos paquetes binarios genera este paquete fuente?
    \item 		¿Qué asistente de creación de paquetes utiliza este paquete?
    \end{itemize}
    \hbr
  \item Construya el paquete
    \hbr
  \item A continuación, modificaremos el paquete. Añada una entrada al registro de
cambios (fichero «changelog») e incremente el número de versión.
    \hbr
  \item Desactive la compatibilidad con las expresiones regulares de Perl
(perl-regexp es una opción de configuración de \texttt{./configure})
    \hbr
  \item Reconstruya el paquete
    \hbr
  \item Compare el paquete original y el nuevo con debdiff
    \hbr
  \item Instale el paquete recién construido
  \end{enumerate}
\end{frame}

\section{Aspectos avanzados de la creación de paquetes}
\subsection{debian/copyright}
\begin{frame}[fragile=singleslide]{debian/copyright}
  \hbr
  \begin{itemize}
  \item Información de derechos de autor, licencia de las fuentes y de la tarea de
creación del paquete
  \item Habitualmente, se escribe como fichero de texto
  \item New machine-readable format:
{\small\url{https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/}}
  \end{itemize}
  \seprule
  \begin{lstlisting}[basicstyle=\ttfamily\scriptsize]
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: X Solitaire
Source: ftp://ftp.example.com/pub/games

Files: *
Copyright: Copyright 1998 John Doe <jdoe@example.com>
License: GPL-2+
 This program is free software; you can redistribute it
 [...]
 .
 On Debian systems, the full text of the GNU General Public
 License version 2 can be found in the file
 `/usr/share/common-licenses/GPL-2'.

Files: debian/*
Copyright: Copyright 1998 Jane Smith <jsmith@example.net>
License:
 [LICENSE TEXT]
\end{lstlisting}
\end{frame}



\subsection{Modificar las fuentes del desarrollador original}
\begin{frame}{Modificar las fuentes del desarrollador original}
  Habitualmente es necesario:
  \begin{itemize}
  \item Arreglar informes de fallo o añadir modificaciones específicas para Debian
    \hbr
  \item Adaptar a una versión anterior los arreglos de una publicación del software
más reciente
  \end{itemize}
  \br
  Existen varios métodos:
  \begin{itemize}
  \item Modificación directa de ficheros
    \begin{itemize}
    \item Sencillo
    \item Pero no ofrece una forma de registrar y documentar los cambios
    \end{itemize}
    \hbr
  \item Utilizar sistemas de parches
    \begin{itemize}
    \item Facilita contribuir sus cambios al desarrollador original
    \item Ayuda a compartir los arreglos con distribuciones derivadas
    \item Gives more exposure to the changes\\ \url{http://patch-tracker.debian.org/}
(down currently)
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}{Sistemas de parches}
  \begin{itemize}
  \item Principio: los cambios se guardan en parches en \texttt{debian/patches/}
    \br
  \item Se integran y eliminan de las fuentes durante la construcción
    \br
  \item Pasado: varias implementaciones -- \textsl{simple-patchsys} (\textsl{cdbs}),
\textsl{dpatch}, \textbf{\textsl{quilt}}
    \begin{itemize}
  \item Cada uno permite dos tareas de \texttt{debian/rules}:
    \begin{itemize}
    \item \texttt{debian/rules patch}: Integra todos los parches
    \item \texttt{debian/rules unpatch}: Elimina todos los parches de las fuentes
    \end{itemize}
	  \hbr
  \item More documentation: \url{https://wiki.debian.org/debian/patches}
  \end{itemize}
  \br
  \item \textbf{Nuevo formato de paquete fuente con sistema de parches integrado: 3.0
(quilt)}
  \begin{itemize}
  \item Solución recomendada
	  \hbr
  \item You need to learn \textsl{quilt}\\ 
\url{https://perl-team.pages.debian.net/howto/quilt.html}
    \hbr
  \item Herramienta de parches independiente del sistema en \texttt{devscripts}:
\texttt{edit-patch}
  \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}[fragile=singleslide]{Documentación de parches}
  \begin{itemize}
	  \item Cabeceras estándar al principio del parche
    \br
  \item Documentado con las normas de etiquetado de parches; DEP-3 - Patch Tagging
Guidelines\\ \url{http://dep.debian.net/deps/dep3/}
  \end{itemize}
  \vfill
\seprule
  \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
Description: Fix widget frobnication speeds
 Frobnicating widgets too quickly tended to cause explosions.
Forwarded: http://lists.example.com/2010/03/1234.html
Author: John Doe <johndoe-guest@users.alioth.debian.org>
Applied-Upstream: 1.2, http://bzr.foo.com/frobnicator/revision/123
Last-Update: 2010-03-29

--- a/src/widgets.c
+++ b/src/widgets.c
@@ -101,9 +101,6 @@ struct {
\end{lstlisting}
\end{frame}

\subsection{Realizar acciones durante la instalación y eliminación}
\begin{frame}{Realizar acciones durante la instalación y eliminación}
  \begin{itemize}
  \item A veces no basta con descomprimir el paquete
    \hbr
  \item Crear/eliminar usuarios del sistema, iniciar/detener servicios, gestionar el
sistema de \textsl{alternativas}
    \hbr
  \item Se realiza mediante \textsl{scripts de desarrollador}\\ \texttt{preinst,
postinst, prerm, postrm}
    \begin{itemize}
	    \item  debhelper puede generar secciones de código para acciones comunes
    \end{itemize}
    \hbr
  \item Documentación:
    \begin{itemize}
    \item Debian Policy Manual, chapter 6\\ {\footnotesize
\url{https://www.debian.org/doc/debian-policy/ch-maintainerscripts}}
      
      \hbr
    \item Debian Developer's Reference, chapter 6.4\\ {\scriptsize
\url{https://www.debian.org/doc/developers-reference/best-pkging-practices.html}}
      \hbr
    \item {\footnotesize
\url{https://people.debian.org/~srivasta/MaintainerScripts.html}}
    \end{itemize}
    \br
  \item Consultar al usuario
    \begin{itemize}
    \item Se debe realizar mediante \textbf{debconf}
      \hbr
    \item Documentación: \texttt{debconf-devel(7)} (paquete \texttt{debconf-doc})
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}[fragile=singleslide]{Supervisar las versiones del desarrollador original}
  \begin{itemize}
  \item Especifique dónde mirar en \texttt{debian/watch} (consulte
\texttt{uscan(1)})
    \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
version=3

http://tmrc.mit.edu/mirror/twisted/Twisted/(\d\.\d)/ \
  Twisted-([\d\.]*)\.tar\.bz2
    \end{lstlisting}
    \br
  \item There are automated trackers of new upstream versions, that notify the
maintainer on various dashboards including \url{https://tracker.debian.org/}
and \url{https://udd.debian.org/dmd/}
    \br
  \item \texttt{uscan}: Ejecuta una comprobación manual
    \br
  \item \texttt{uupdate}: Intenta actualizar el paquete a la última versión de la
fuente original
  \end{itemize}
\end{frame}

\subsection{Creación de paquetes con un sistema de control de versiones (SVN, Git)}
\begin{frame}[fragile=singleslide]{Creación de paquetes con un sistema de control de versiones}
  \begin{itemize}
  \item Existen varias herramientas que facilitan la gestión de ramas y etiquetas
para las tareas de creación de paquete:\\ \texttt{svn-buildpackage},
\texttt{git-buildpackage}
    \hbr
  \item Ejemplo: \texttt{git-buildpackage}
    \begin{itemize}
    \item La rama \texttt{upstream} contiene los cambios de la fuente original de
software mediante etiquetas \texttt{upstream/\textsl{versión}}
    \item La rama \texttt{master} contiene los cambios hechos al paquete Debian
    \item Etiquetas \texttt{debian/\textsl{versión}} para cada envío de datos
    \item La rama \texttt{pristine-tar} para poder reconstruir el archivo tar de la
fuente de software original
    \end{itemize}
    Doc:
\url{http://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.html}
    \hbr
  \item Campos \texttt{Vcs-*} en \texttt{debian/control} para ubicar el repositorio
	  \begin{itemize}
		\item \url{https://wiki.debian.org/Salsa}
	\end{itemize}
\end{itemize}
  \begin{lstlisting}[basicstyle=\ttfamily\scriptsize]
Vcs-Browser: https://salsa.debian.org/debian/devscripts
Vcs-Git: https://salsa.debian.org/debian/devscripts.git
  \end{lstlisting}
  \begin{lstlisting}[basicstyle=\ttfamily\scriptsize]
Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libwww-perl
Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libwww-perl.git
  \end{lstlisting}
  \begin{itemize}
  \item Interfaz independiente del sistema de control de versiones:
\texttt{debcheckout}, \texttt{debcommit}, \texttt{debrelease}\\
    \begin{itemize}
	    \item     \texttt{debcheckout grep} $\rightarrow$ obtiene el paquete fuente de un
repositorio Git
    \end{itemize}
\end{itemize}
\end{frame}

\subsection{Adaptación de paquetes a una publicación anterior}
\begin{frame}{Adaptación de paquetes a una publicación anterior}
  \begin{itemize}
  \item Objetivo: utilizar una versión más reciente de un paquete en un sistema más
antiguo\\ Por ejemplo, utilizar \textsl{mutt} de la publicación
\textsl{unstable} («inestable») de Debian en la publicación \textsl{stable}
(«estable»)
	\br
  \item Idea general:
	  \begin{itemize}
		\item Obtenga el paquete fuente de Debian «inestable»
		\hbr
		\item Modifique de forma que se construya y funcione de forma adecuada en la
publicación estable de Debian
		\begin{itemize}
			\item A veces trivial (no se requieren cambios)
			\item A veces difícil
			\item A veces imposible (muchas dependencias no disponibles)
		\end{itemize}
	\end{itemize}
	\br
   \item El proyecto Debian proporciona y mantiene algunas adaptaciones a
publicaciones anteriores\\ \url{http://backports.debian.org/}
\end{itemize}
\end{frame}



\section{Desarrollar paquetes en Debian}
\subsection{Debian archive and suites}
\begin{frame}{Debian archive and suites}
  \begin{center}
	  \resizebox{\textwidth}{!}{
    \begin{tikzpicture}[
	    people/.style={shape=ellipse,draw,thick},
      suite/.style={shape=rectangle,draw},
	    devel/.style={fill=red!30!white},
	    test/.style={fill=orange!30!white},
	    prod/.style={fill=green!30!white,node distance=2cm},
	    internal/.style={},
	    old/.style={fill=gray!30!white},
	    veryold/.style={fill=gray!70!white},
      arr/.style={very thick},
	    uploads/.style={decorate,decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}},
	    migrations/.style={};
	    command/.style={text=rouge,font=\ttfamily},
	    legend/.style={font=\small}
	    ]
      
      \draw node[suite,prod] (sec) {security}; \draw node[suite,prod,right=of sec]
(su) {stable-updates}; \draw node[suite,prod,right=of su] (st) {stable};
\draw node[suite,old,node distance=0.3cm,below=of st] (os) {oldstable};
\draw node[suite,veryold,node distance=0.3cm,below=of os] (ar)
{archive.d.o}; \draw node[suite,prod,right=of st] (bp) {backports}; \draw
node[suite,test] (spu) at ($(su) + (-0.6,2.5)$) {stable-proposed-updates};
\draw node[suite,internal] (sn) at ($(st) + (-1.8,1.4)$) {stable-new}; \draw
node[suite,test,node distance=1.5cm,above=of st] (te) {testing}; \draw
node[suite,devel,above=of te] (sid) {unstable}; \draw node[suite,devel]
(exp) at ($(sid) + (2.5,0.5)$) {experimental}; \draw node[suite,devel] (tpu)
at ($(te)!0.5!(sid) + (2.5,0)$) {testing-proposed-updates}; \draw
node[people,above=of sid] (dd) {developer}; \draw node[people,node
distance=3cm,left=of dd] (secteam) {security team}; \draw[arr,uploads,->]
(dd) -- (sid); \draw[arr,uploads,->] (dd) -- (exp);
\draw[arr,uploads,->,bend right=8] (dd) to (tpu); \draw[arr,uploads,->]
(secteam) -- (sid); \draw[arr,uploads,->] (secteam) -- (sec);
\draw[arr,uploads,->] (dd) to (spu); \draw[arr,uploads,->] plot [smooth,
tension=0.75] coordinates { (dd.east) ($(exp.north east)+(0.1,0.1)$)
($(tpu.east)+(0.2,0)$)  ($(bp.north east) + (-0.4,0)$) };
\draw[arr,migrations,->] (tpu) -- (te); \draw[arr,migrations,->] (sid) --
(te); \draw[arr,migrations,->] (te) -- (st) node
[midway,align=left,midway,right,font=\footnotesize] {stable\\ release};
\draw[arr,migrations,->] (sec) -- (sn); \draw[arr,migrations,->] (sn) to
node [pos=0.2] (spulabel) {} (st); \draw
node[font=\footnotesize,align=right] at ($(spulabel) + (-0.4,-0.45)$)
{stable \\ point \\ release}; \draw[arr,migrations,->] (spu) to (sn);
\draw[arr,migrations,->] (spu) -- (su); \draw[arr,migrations,->] (st) --
(os); \draw[arr,migrations,->] (os) -- (ar); \coordinate (legend) at
(-2,-1); \draw[arr,uploads,->] (legend) -- ($(legend) + (0.7,0)$) node
[right,legend] {package uploads}; \coordinate[node distance=1.1em,below=of
legend] (legend2); \draw[arr,migrations,->] (legend2) -- ($(legend2) +
(0.7,0)$) node [right,legend] {package migrations between suites};
\coordinate[node distance=1.5em,below=of legend2] (legend3); \draw
node[right,suite,devel,legend] (ldev) at (legend3) {development}; \draw
node[node distance=0.1cm,right=of ldev,suite,test,legend] (ltest) {test};
\draw node[node distance=0.1cm,right=of ltest,suite,internal,legend] (lint)
{internal}; \draw node[node distance=0.1cm,right=of lint,suite,prod,legend]
(lprod) {production}; \draw ($(legend.north west) + (-0.1,0.25)$) rectangle
($(lprod.south east) + (0.1,-0.1)$); \draw
node[font=\bf,red!70!white,align=center] (tnext) at ($(te.east) + (2,-0.1)$)
{preparation of \\ next release}; \draw
node[font=\bf,green!70!black,align=center] (tsrm) at ($(sec.north east) +
(1,1)$) {stable\\release\\management}; \pgfdeclarelayer{background}
\pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground}
\begin{pgfonlayer}{background}
	    \fill[red!10!white] plot [smooth cycle,tension=0.55] coordinates {
($(sid.north west) + (-0.1,0.1)$) ($(exp.north east)+(0.1,0.1)$)
($(tpu.south east)+(0.1,-0.1)$) ($(tnext.south) + (0.6,0)$) ($(te.south
west) + (0.1,-0.1)$)  }; \fill[green!10!white] plot [smooth
cycle,tension=0.55] coordinates { ($(spu.north west) + (-0.1,0.1)$)
($(spu.north east)+(0.1,0.1)$) ($(sn.north east)+(0.1,0.1)$) ($(st.north
east) + (0.1,0.5)$) ($(bp.north east) + (0.1,0.1)$)  ($(bp.south east) +
(0.1,-0.1)$) ($(sec.south west) + (-0.1,-0.1)$)  };
\end{pgfonlayer}

    \end{tikzpicture}
	  }
  \end{center}
	\begin{flushright}
		\tiny Based on graph by Antoine
Beaupr\'e. \url{https://salsa.debian.org/debian/package-cycle}~~~~~~~~~~~~
	\end{flushright}
\end{frame}

\begin{frame}{Suites for development}
		\begin{itemize}
			\item New versions of packages are uploaded to \textbf{unstable} (\textbf{sid})
				\hbr
			\item Packages migrate from \textbf{unstable} to \textbf{testing} based on several
criterias (e.g. has been in unstable for 10 days, and no regressions)
				\hbr
			\item New packages can also be uploaded to:
				\begin{itemize}
					\item \textbf{experimental} (for more \textsl{experimental} packages, such as when
the new version is not ready to replace the one currently in unstable)
						\hhbr
					\item \textbf{testing-proposed-updates}, to update the version in \textbf{testing}
without going through \textbf{unstable} (this is rarely used)
				\end{itemize}
		\end{itemize}
\end{frame}

\begin{frame}{Freezing and releasing}
	\begin{itemize}
					\item At some point during the release cycle, the release team decides to
\textsl{freeze} testing: automatic migrations from \textbf{unstable} to
\textbf{testing} are stopped, and replaced by manual review
						\br
		\item When the release team considers \textbf{testing} to be ready for release:
			\begin{itemize}
				\item The \textbf{testing} suite becomes the new \textbf{stable} suite
					\hhbr
				\item Similarly, the old \textbf{stable} becomes \textbf{oldstable}
					\hhbr
				\item Unsupported releases are moved to \texttt{archive.debian.org}
			\end{itemize}
			\br
		\item See \url{https://release.debian.org/}
	\end{itemize}
\end{frame}

\begin{frame}{Stable release suites and management}
	\begin{itemize}
		\item Several suites are used to provide stable release packages:
			\hhbr
			\begin{itemize}
				\item \textbf{stable}: the main suite
					\hbr
				\item \textbf{security} updates suite provided on \texttt{security.debian.org},
used by the security team. Updates are announced on the
\texttt{debian-security-announce} mailing list
					\hbr
				\item \textbf{stable-updates}: updates that are not security related, but that
should urgently be installed (without waiting for the next point release):
antivirus databases, timezone-related packages, etc. Announced on the
\texttt{debian-stable-announce} mailing list
					\hbr
				\item \textbf{backports}: new upstream versions, based on the version in
\textbf{testing}
			\end{itemize}
			\hbr
		\item The \textbf{stable} suite is updated every few months by \textsl{stable
point releases} (that include only bug fixes)
			\hhbr
			\begin{itemize}
				\item Packages targetting the next stable point release are uploaded to
\textbf{stable-proposed-updates} and reviewed by the release team
			\end{itemize}
			\hbr
		\item The \textbf{oldstable} release has the same set of suites
	\end{itemize}
\end{frame}

\subsection{Hay varias formas de contribuir a Debian}
\begin{frame}{Hay varias formas de contribuir a Debian}
  \begin{itemize}
  \item \textbf{La peor} forma de contribuir:
    \begin{enumerate}
    \item Empaquetar su propio programa
    \item Introducirlo en Debian
    \item Desaparecer
    \end{enumerate}
    \br
  \item \textbf{Las mejores} formas de contribuir:
	  \begin{itemize}
		  \item Únase a equipos de creación de paquetes
    \begin{itemize}
    \item Hay varios equipos que se centran en un conjunto de paquetes, y necesitan
ayuda
    \item List available at \url{https://wiki.debian.org/Teams}
    \item Una excelente forma de aprender de otros contribuyentes experimentados
    \end{itemize}
    \br
\item Adopte paquetes existentes sin responsable, (\textsl{paquetes huérfanos})
    \br
  \item Traiga software nuevo a Debian
    \begin{itemize}
    \item Por favor, solo si es suficientemente interesante y útil
    \item ¿Hay alternativas ya empaquetadas para Debian?
    \end{itemize}
  \end{itemize}

  \end{itemize}
\end{frame}

\subsection{Adopción de paquetes huérfanos}
\begin{frame}{Adopción de paquetes huérfanos}
      \hbr
  \begin{itemize}
    \item Existen varios paquetes sin responsable en Debian
    \hbr
  \item Full list + process: \url{https://www.debian.org/devel/wnpp/}
    \hbr
  \item Installed on your machine: \texttt{wnpp-alert}\\ Or better:
\texttt{how-can-i-help}
    \hbr
  \item Diferentes estados:
    \begin{itemize}
		    \small
    \item \textbf{O}rphaned (huérfano): el paquete no tiene responsable\\ Adóptelo sin
problemas
      \hbr
    \item \textbf{RFA}: \textbf{R}equest \textbf{F}or \textbf{A}dopter\\ El
responsable busca alguien que lo adopte, pero continua trabajando en él\\ 
Adóptelo sin problemas. Se recomienda enviar un correo electrónico al
responsable actual.
      \hbr
    \item ¡\textbf{ITA}: \textbf{I}ntent \textbf{T}o \textbf{A}dopt\\ Alguien intenta
adoptar el paquete\\ ¡Puede ofrecer su ayuda!
      \hbr
    \item \textbf{RFH}: \textbf{R}equest \textbf{F}or \textbf{H}elp\\ El responsable
busca ayuda
    \end{itemize}
    \hbr
  \item No se detectan algunos paquetes sin desarrollador \arr aún no están
huérfanos
    \hbr
  \item Si duda, pregunte en \texttt{debian-qa@lists.debian.org} \\ o
\texttt{\#debian-qa} en \texttt{irc.debian.org}
  \end{itemize}
\end{frame}

\begin{frame}[fragile=singleslide]{Adopción de un paquete: ejemplo}
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize,escapeinside=\{\}]
From: Usted <usted@su-dominio>
To: 640454@bugs.debian.org, control@bugs.debian.org
Cc: Francois Marier <francois@debian.org>
Subject: ITA: verbiste -- French conjugator

retitle 640454 ITA: verbiste -- French conjugator
owner 640454 !
thanks

Hi,

I am using verbiste and I am willing to take care of the package.

Cheers,

Su nombre
\end{lstlisting}

\begin{itemize}
\item Se recomienda contactar con el responsable anterior (en particular si el
paquete se declaró como RFA, petición de adopción, en lugar de declararse
huérfano)
\item Se recomienda contactar con la fuente original del proyecto
\end{itemize}
\end{frame}

\subsection{Introducir su paquete en Debian}
\begin{frame}{Introducir su paquete en Debian}
\begin{itemize}
\item No precisa de ningún rol oficial para introducir su paquete en Debian
	\begin{enumerate}
		\item Submit an \textbf{ITP} bug (\textbf{I}ntent \textbf{T}o \textbf{P}ackage)
using \texttt{reportbug wnpp}
			\hbr
		\item Prepare un paquete fuente
			\hbr
		\item Encuentre un desarrollador oficial de Debian que patrocine su paquete 
	\end{enumerate}
\br
\item Official status (when you are an experienced package maintainer):
	\begin{itemize}
		\item \textbf{Debian Maintainer (DM):}\\ Permission to upload your own packages\\ 
See \url{https://wiki.debian.org/DebianMaintainer}
			\hbr
		\item \textbf{Debian Developer (DD):}\\ Debian project member; can vote and upload
any package
	\end{itemize}
\end{itemize}
\end{frame}

\begin{frame}{Things to check before asking for sponsorship}
\begin{itemize}
	\item Debian puts \textbf{a lot of focus on quality}
\hbr
\item Generally, \textbf{sponsors are hard to find and busy}
\begin{itemize}
\item Make sure your package is ready before asking for sponsorship
\end{itemize}
\hbr
\item Things to check:
\begin{itemize}
\item Avoid missing build-dependencies: make sure that your package build fine in
a clean \textsl{sid} \textsl{chroot}
\begin{itemize}
\item Using \texttt{pbuilder} is recommended
\end{itemize}
\hbr
\item Run \texttt{lintian -EviIL +pedantic} on your package
\begin{itemize}
\item Errors must be fixed, all other problems should be fixed
\end{itemize}
\hbr
\item Do extensive testing of your package, of course
\end{itemize}
\hbr
\item In doubt, ask for help
\end{itemize}
\end{frame}

\subsection{¿Dónde encontrar ayuda?}
\begin{frame}{¿Dónde encontrar ayuda?}
	\hbr
  Ayuda necesaria:
  \begin{itemize}
  \item Consejos y respuestas a sus preguntas, revisiones de código
  \item Apoyo y supervisión para sus envíos de paquete, una vez que está listo
  \end{itemize}
  \hbr
  Puede conseguir ayuda de:
  \begin{itemize}
	  \item \textbf{Otros miembros del equipo de creación de paquetes}
    \begin{itemize}
    \item List of teams: \url{https://wiki.debian.org/Teams}
    \end{itemize}
    \hbr
  \item The \textbf{Debian Mentors group} (if your package does not fit in a team)
    \begin{itemize}
    \item \url{https://wiki.debian.org/DebianMentorsFaq}
    \item Lista de correo: \url{debian-mentors@lists.debian.org}\\ {\small (otra buena
forma de aprender es a través de los problemas)}
    \item IRC: \texttt{\#debian-mentors} en \texttt{irc.debian.org}
    \item \url{http://mentors.debian.net/}
    \item Documentation: \url{http://mentors.debian.net/intro-maintainers}
    \end{itemize}
    \hbr
  \item \textbf{Localized mailing lists} (get help in your language)
    \begin{itemize}
  \item \texttt{debian-devel-\{french,italian,portuguese,spanish\}@lists.d.o}
  \item Full list: \url{https://lists.debian.org/devel.html}
  \item Or users lists: \url{https://lists.debian.org/users.html}
  \end{itemize}
  \end{itemize}
\end{frame}

\subsection{More documentation}
\begin{frame}{More documentation}
  \begin{itemize}
  \item Debian Developers' Corner\\ \url{https://www.debian.org/devel/}\\ {\small
Links to many resources about Debian development}
    \hbr
  \item Guide for Debian Maintainers\\ 
\url{https://www.debian.org/doc/manuals/debmake-doc/}
    \hbr
  \item Debian Developer's Reference\\ 
\url{https://www.debian.org/doc/developers-reference/}\\ {\small Mostly
about Debian procedures, but also some best packaging practices (part 6)}
    \hbr
  \item Debian Policy\\ \url{https://www.debian.org/doc/debian-policy/}\\
    
    {\small \begin{itemize} \item \small Todos los requisitos que cada paquete
debe cumplir \item \small Normas especiales para Perl, Java, Python, \ldots
\end{itemize}}
    \hbr
    
  \item Ubuntu Packaging Guide\\ 
\url{https://packaging.ubuntu.com/html/}
  \end{itemize}
\end{frame}

\subsection{Interfaces para desarrolladores de Debian}
\begin{frame}{Interfaces para desarrolladores de Debian}
  \begin{itemize}
	  \item \textbf{Source package centric}:\\ \url{https://tracker.debian.org/dpkg}
    \br
  \item \textbf{Maintainer/team centric}: Developer's Packages Overview (DDPO)\\ 
\url{https://qa.debian.org/developer.php?login=pkg-ruby-extras-maintainers@lists.alioth.debian.org}
    \br
  \item \textbf{TODO-list oriented}: Debian Maintainer Dashboard (DMD)\\ 
\url{https://udd.debian.org/dmd/}
  \end{itemize}
\end{frame}

\begin{frame}{Using the Debian Bug Tracking System (BTS)}
\begin{itemize}
\item A quite unique way to manage bugs
\begin{itemize}
\item Web interface to view bugs
\item Email interface to make changes to bugs
\end{itemize}
\hbr
\item Adding information to bugs:
	\begin{itemize}
		\item Write to \texttt{123456@bugs.debian.org} (does not include the submitter,
you need to add \texttt{123456-submitter@bugs.debian.org})
	\end{itemize}
\hbr
\item Changing bug status:
\begin{itemize}
\item Send commands to \texttt{control@bugs.debian.org}
\item Command-line interface: \texttt{bts} command in \texttt{devscripts}
\item Documentation: \url{https://www.debian.org/Bugs/server-control}
\end{itemize}
\hbr
\item Reporting bugs: use \texttt{reportbug}
\begin{itemize}
\item Normally used with a local mail server: install \texttt{ssmtp} or
\texttt{nullmailer}
\item Or use \texttt{reportbug -\@-template}, then send (manually) to
\texttt{submit@bugs.debian.org}
\end{itemize}
\end{itemize}
\end{frame}

\begin{frame}{Using the BTS: examples}
\begin{itemize}
\item Sending an email to the bug and the submitter:\\ 
\url{https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680822\#10}
\hbr
\item Tagging and changing the severity:\\ 
\url{https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680227\#10}
\hbr
\item Reassigning, changing the severity, retitling \ldots: \\ 
\url{https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680822\#93}
\begin{itemize}
	\item \texttt{notfound}, \texttt{found}, \texttt{notfixed}, \texttt{fixed} are for
\textbf{version-tracking} \\ See
\url{https://wiki.debian.org/HowtoUseBTS\#Version\_tracking}
\end{itemize}
\hbr
\item Using usertags:
\url{https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=42;bug=642267}\\ See
\url{https://wiki.debian.org/bugs.debian.org/usertags}
\hbr
\item BTS Documentation:
\begin{itemize}
\item \url{https://www.debian.org/Bugs/}
\item \url{https://wiki.debian.org/HowtoUseBTS}
\end{itemize}
\end{itemize}
\end{frame}

\subsection{¿Más interesado en Ubuntu?}
\begin{frame}{¿Más interesado en Ubuntu?}
  \begin{itemize}
  \item En general, Ubuntu gestiona las diferencias con respecto a Debian
    \br
  \item No hay un enfoque en paquetes específicos\\ En su lugar, se colabora con
equipos de Debian
    \br
  \item Habitualmente, recomiende enviar nuevos paquetes primero a Debian \\ 
\url{https://wiki.ubuntu.com/UbuntuDevelopment/NewPackages}
    \br
  \item Un mejor plan probablemente sería:
    \begin{itemize}
    \item Participar en un equipo de Debian y actuar como enlace con Ubuntu
      \hbr
    \item Ayude a reducir las diferencias, evalúe los informes de fallo en Launchpad
      \hbr
    \item Muchas herramientas de Debian le pueden ayudar:
      \begin{itemize}
      \item La columna de Ubuntu en la vista general de paquetes para desarrolladores de
Debian
      \item El recuadro de Ubuntu en el sistema de seguimiento de paquetes (PTS)
      \item Reciba correo electrónico de informes de fallo de Launchpad a través del PTS
      \end{itemize}
    \end{itemize}
  \end{itemize}
\end{frame}

\section{Conclusions}
\subsection{Conclusions}
\begin{frame}{Conclusions}
  \begin{itemize}
  \item Ahora tiene una idea general completa de la creación de paquetes Debian
    \br
  \item Pero tendrá que leer más documentación
    \br
  \item Las mejores prácticas se desarrollan con el tiempo
    \begin{itemize}
    \item Si no está seguro, utilice el asistente de creación de paquetes \textbf{dh},
y el formato \textbf{3.0 (quilt)}
    \end{itemize}
  \end{itemize}
  \vfill
  \centerline{\large Feedback: \textbf{packaging-tutorial@packages.debian.org}}
\end{frame}

\subsection{Asuntos legales}
\begin{frame}{Asuntos legales}

  Copyright \copyright 2011--2019 Lucas Nussbaum -- lucas@debian.org
  \br

  {\small \textbf{Este documento es software libre}: puede redistribuirlo y/o
modificarlo bajo ambas (a su elección): \hbr \begin{itemize} \item Los
términos de la GNU General Public License como publica la Free Software
Foundation, bien la versión 3 de la licencia, o (a su elección) cualquier
versión posterior.\\ \url{http://www.gnu.org/licenses/gpl.html} \br \item
Los términos de la Creative Commons Attribution-ShareAlike 3.0 Unported
License.\\ \url{http://creativecommons.org/licenses/by-sa/3.0/}
\end{itemize} }
\end{frame}

\subsection{Contribute to this tutorial}
\begin{frame}{Contribute to this tutorial}
	\begin{itemize}
		\item Contribuya:
			\begin{itemize}
				\item{\small \texttt{apt-get source packaging-tutorial}}
					\hbr
				\item  {\small \texttt{debcheckout packaging-tutorial}}
					\hbr
				\item  {\small \texttt{git clone\\ 
https://salsa.debian.org/debian/packaging-tutorial.git}}
					\hbr
				\item {\small \url{https://salsa.debian.org/debian/packaging-tutorial}}
					\hbr
				\item {\small Open bugs: \url{bugs.debian.org/src:packaging-tutorial}}
			\end{itemize}
			\br
		\item Provide feedback:
			\begin{itemize}
				\item \href{mailto:packaging-tutorial@packages.debian.org}{\textbf{\texttt{mailto:packaging-tutorial@packages.debian.org}}}
				\begin{itemize}
					\item{\small What should be added to this tutorial?}
				\item {\small What should be improved?}
				\end{itemize}
					\hbr
				\item{\small \texttt{reportbug packaging-tutorial}}
			\end{itemize}
	\end{itemize}
\end{frame}

\section{Additional practical sessions}

\subsection{Ejercicio práctico 2: empaquetar GNUjump}
\begin{frame}{Ejercicio práctico 2: empaquetar GNUjump}
	\begin{enumerate}
		\item Download GNUjump 1.0.8 from
\url{http://ftp.gnu.org/gnu/gnujump/gnujump-1.0.8.tar.gz}
			\br
		\item Cree un paquete Debian para él
			\begin{itemize}
				\item Instale las dependencias de construcción para poder construir el paquete
				\item Fix bugs
				\item Obtener un paquete básico funcional
				\item Termine de completar \texttt{debian/control} y otros ficheros
			\end{itemize}
			\br
		\item Disfrute
	\end{enumerate}
\centerline{\includegraphics[width=5cm]{figs/gnujump.png}}
\end{frame}

\begin{frame}[fragile=singleslide]{Practical session 2: packaging GNUjump (tips)}
	\begin{itemize}
		\item To get a basic working package, use \texttt{dh\_make}
		\item To start with, creating a \textsl{1.0} source package is easier than
\textsl{3.0 (quilt)} (change that in \texttt{debian/source/format})
		\item To search for missing build-dependencies, find a missing file, and use
\texttt{apt-file} to find the missing package
		\item If you encounter that error:
\begin{lstlisting}[basicstyle=\ttfamily\tiny]
/usr/bin/ld: SDL_rotozoom.o: undefined reference to symbol 'ceil@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:376: recipe for target 'gnujump' failed
\end{lstlisting}
			You need to add \texttt{-lm} to the linker command line:\\ Edit
\texttt{src/Makefile.am} and replace
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
gnujump_LDFLAGS = $(all_libraries)
\end{lstlisting}
					by
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
gnujump_LDFLAGS = -Wl,--as-needed
gnujump_LDADD = $(all_libraries) -lm
\end{lstlisting}
				Then run \texttt{autoreconf -i}
	\end{itemize}
\end{frame}

\subsection{Ejercicio práctico 3: empaquetar una biblioteca de Java}
\begin{frame}{Ejercicio práctico 3: empaquetar una biblioteca de Java}
\begin{enumerate}
	\item Consulte brevemente la documentación sobre creación de paquetes de Java:\\
		\begin{itemize}
		\item \url{https://wiki.debian.org/Java}
      \hbr
		\item \url{https://wiki.debian.org/Java/Packaging}
      \hbr
		\item \url{https://www.debian.org/doc/packaging-manuals/java-policy/}
      \hbr
		\item \texttt{/usr/share/doc/javahelper/tutorial.txt.gz}
		\end{itemize}
		\br
	\item Descargue IRClib desde \url{http://moepii.sourceforge.net/}
		\br
	\item Empaquételo
\end{enumerate}
\end{frame}

\subsection{Ejercicio práctico 4: empaquetar un «gem» de Ruby}
\begin{frame}{Ejercicio práctico 4: empaquetar un «gem» de Ruby}
\begin{enumerate}
	\item Consulte brevemente la documentación sobre creación de paquetes de Ruby:\\
		\begin{itemize}
		\item \url{https://wiki.debian.org/Ruby}
      \hbr
		\item \url{https://wiki.debian.org/Teams/Ruby}
      \hbr
		\item \url{https://wiki.debian.org/Teams/Ruby/Packaging}
      \hbr
		\item \texttt{gem2deb(1)}, \texttt{dh\_ruby(1)} (en el paquete \texttt{gem2deb})
		\end{itemize}
		\hbr
	\item Create a basic Debian source package from the \texttt{peach} gem:\\ 
\texttt{gem2deb peach}
	\hbr
	\item Modifíquelo para que sea un paquete de Debian adecuado
\end{enumerate}
\end{frame}

\subsection{Practical session 5: packaging a Perl module}
\begin{frame}[fragile=singleslide]{Practical session 5: packaging a Perl module}
\begin{enumerate}
	\item Take a quick look at some documentation about Perl packaging:\\
		\begin{itemize}
		\item \url{https://perl-team.pages.debian.net}
      \hbr
		\item \url{https://wiki.debian.org/Teams/DebianPerlGroup}
      \hbr
		\item \texttt{dh-make-perl(1)}, \texttt{dpt(1)} (in the \texttt{pkg-perl-tools}
package)
		\end{itemize}
		\hbr
	\item Create a basic Debian source package from the \texttt{Acme} CPAN
distribution:\\ \verb|dh-make-perl --cpan Acme|
	\hbr
	\item Modifíquelo para que sea un paquete de Debian adecuado
\end{enumerate}
\end{frame}

\section{Respuestas a ejercicios prácticos}

\begin{frame}
	\begin{center}
		\LARGE Respuestas a \\[0.5em] ejercicios prácticos
	\end{center}
\end{frame}


\subsection{Ejercicio práctico 1: modificar el paquete grep}

\begin{frame}{Ejercicio práctico 1: modificar el paquete grep}
\begin{enumerate}
  \item Go to \url{http://ftp.debian.org/debian/pool/main/g/grep/} and download
version 2.12-2 of the package

	\item Consulte los ficheros en \texttt{debian/}.
		\begin{itemize}
			\item 		¿Cuántos paquetes binarios genera este paquete fuente?
			\item 		¿Qué asistente de creación de paquetes utiliza este paquete?
		\end{itemize}
    \hbr
	\item Construya el paquete
    \hbr
	\item A continuación, modificaremos el paquete. Añada una entrada al registro de
cambios (fichero «changelog») e incremente el número de versión.
    \hbr
	\item Desactive la compatibilidad con las expresiones regulares de Perl
(perl-regexp es una opción de configuración de \texttt{./configure})
    \hbr
	\item Reconstruya el paquete
    \hbr
	\item Compare el paquete original y el nuevo con debdiff
    \hbr
	\item Instale el paquete recién construido
\end{enumerate}
\end{frame}

\begin{frame}{Obtener las fuentes}
\begin{enumerate}
  \item Go to \url{http://ftp.debian.org/debian/pool/main/g/grep/} and download
version 2.12-2 of the package
\end{enumerate}
\begin{itemize}
	\item Use dget to download the \texttt{.dsc} file:\\ {\small \texttt{dget
http://cdn.debian.net/debian/pool/main/g/grep/grep\_2.12-2.dsc}}
		\hbr
	\item If you have \texttt{deb-src} for a Debian release that has \texttt{grep}
version 2.12-2 (find out on \url{https://tracker.debian.org/grep}), you can
use: \texttt{apt-get source grep=2.12-2}\\ or \texttt{apt-get source
grep/release} (e.g. \texttt{grep/stable})\\ or, if you feel lucky:
\texttt{apt-get source grep}
	\hbr
	\item El paquete fuente de {grep} se compone de 3 ficheros:
		\begin{itemize}
			\item \texttt{grep\_2.12-2.dsc}
			\item \texttt{grep\_2.12-2.debian.tar.bz2}
			\item \texttt{grep\_2.12.orig.tar.bz2}
		\end{itemize}
		Esto es típico con el formato «3.0 (quilt)».
	\hbr
\item If needed, uncompress the source with\\ \texttt{dpkg-source -x
grep\_2.12-2.dsc}
\end{itemize}
\end{frame}

\begin{frame}{Explorar y construir el paquete}
	\begin{enumerate}
			\setcounter{enumi}{1}
	\item Look at the files in \texttt{debian/}
		\begin{itemize}
			\item 		¿Cuántos paquetes binarios genera este paquete fuente?
			\item 		¿Qué asistente de creación de paquetes utiliza este paquete?
		\end{itemize}
	\end{enumerate}
	\hbr
	\begin{itemize}
		\item De acuerdo a \texttt{debian/control}, este paquete genera un solo paquete
binario, llamado \texttt{grep}.
			\hbr
		\item De acuerdo a \texttt{debian/rules}, este paquete es típico del asistente
\textsl{clásico} debhelper, sin utilizar \textsl{CDBS} o \textsl{dh}. Se
pueden ver las múltiples invocaciones a órdenes \texttt{dh\_*} en
\texttt{debian/rules}.
	\end{itemize}
	\hbr
	\begin{enumerate}
			\setcounter{enumi}{2}

		\item Construya el paquete
	\end{enumerate}
	\hbr
	\begin{itemize}
		\item Utilice \texttt{apt-get build-dep grep} para obtener las dependencias de
construcción
		\item A continuación, ejecute \texttt{debuild} o \texttt{dpkg-buildpackage -us
-uc} (Llevará en torno a 1 minuto)
	\end{itemize}
\end{frame}

\begin{frame}{Editar el registro de cambios}
	\begin{enumerate}
			\setcounter{enumi}{3}

	\item A continuación, modificaremos el paquete. Añada una entrada al registro de
cambios (fichero «changelog») e incremente el número de versión.
	\end{enumerate}
	\hbr
	\begin{itemize}
		\item \texttt{debian/changelog} es un fichero de texto. Puede editarlo y añadir
una entrada nueva manualmente.
	\hbr
		\item O puede utilizar \texttt{dch -i}, que añadirá una entrada y ejecutará el
editor
	\hbr
		\item El nombre y correo electrónico se puede definir con las variables de entorno
\texttt{DEBFULLNAME} y \texttt{DEBEMAIL}
	\hbr
		\item A continuación, reconstruya el paquete: una nueva versión del paquete es
generada
	\hbr
		\item Package versioning is detailed in section 5.6.12 of the Debian policy\\ 
\url{https://www.debian.org/doc/debian-policy/ch-controlfields}
	\end{itemize}
\end{frame}

\begin{frame}{Desactivar la compatibilidad con expresiones regulares de Perl y reconstruir}
	\begin{enumerate}
			\setcounter{enumi}{4}

	\item Desactive la compatibilidad con las expresiones regulares de Perl
(perl-regexp es una opción de configuración de \texttt{./configure})
	\item Reconstruya el paquete
	\end{enumerate}
	\hbr
	\begin{itemize}
	  \item Para comprobar, utilice \texttt{./configure -{}-help}: la opción para
desactivar la compatibilidad con expresiones regulares de Perl es
\texttt{-{}-disable-perl-regexp}
	\hbr
		\item Edite \texttt{debian/rules} y busque la línea con \texttt{./configure}
	\hbr
		\item Añada \texttt{-{}-disable-perl-regexp}
	\hbr
		\item Reconstruya el paquete con \texttt{debuild} o \texttt{dpkg-buildpackage -us
-uc}
	\end{itemize}
\end{frame}

\begin{frame}{Comparar y comprobar los paquetes}
	\begin{enumerate}
			\setcounter{enumi}{6}

	\item Compare el paquete original y el nuevo con debdiff
	\item Instale el paquete recién construido
	\end{enumerate}
	\hbr
	\begin{itemize}
		\item Compare los paquetes binarios: \texttt{debdiff ../*changes}
	\hbr
		\item Compare los paquetes fuente: \texttt{debdiff ../*dsc}
	\hbr
		\item Instale el paquete recién creado: \texttt{debi}\\ o \texttt{dpkg -i
../grep\_<TAB>}
	\hbr
		\item ¡\texttt{grep -P foo} ya no funciona!
	\end{itemize}
\br
Reinstall the previous version of the package:
\begin{itemize}
	\item \texttt{apt-get install -{}-reinstall grep=2.6.3-3} \textit{(= versión
anterior)}
\end{itemize}
\end{frame}

\subsection{Ejercicio práctico 2: empaquetar GNUjump}
\begin{frame}{Ejercicio práctico 2: empaquetar GNUjump}
\begin{enumerate}
	\item Download GNUjump 1.0.8 from
\url{http://ftp.gnu.org/gnu/gnujump/gnujump-1.0.8.tar.gz}
		\br
	\item Cree un paquete Debian para él
		\begin{itemize}
			\item Instale las dependencias de construcción para poder construir el paquete
			\item Obtener un paquete básico funcional
			\item Termine de completar \texttt{debian/control} y otros ficheros
		\end{itemize}
		\br
	\item Disfrute
\end{enumerate}
\centerline{\includegraphics[width=5cm]{figs/gnujump.png}}
\end{frame}

\begin{frame}[fragile=singleslide]{Paso a paso\ldots}
\begin{itemize}
	\item \texttt{wget http://ftp.gnu.org/gnu/gnujump/gnujump-1.0.8.tar.gz}
		\hbr
	\item \texttt{mv gnujump-1.0.8.tar.gz gnujump\_1.0.8.orig.tar.gz}
		\hbr
	\item \texttt{tar xf gnujump\_1.0.8.orig.tar.gz}
		\hbr
	\item \texttt{cd gnujump-1.0.8/}
		\hbr
	\item \texttt{dh\_make -f ../gnujump-1.0.8.tar.gz}
	\begin{itemize}
		\item \small Tipo de paquete: binario único (por ahora)
	\end{itemize}
\end{itemize}
\begin{lstlisting}[basicstyle=\ttfamily\small]
gnujump-1.0.8$ ls debian/
changelog           gnujump.default.ex   preinst.ex
compat              gnujump.doc-base.EX  prerm.ex
control             init.d.ex            README.Debian
copyright           manpage.1.ex         README.source
docs                manpage.sgml.ex      rules
emacsen-install.ex  manpage.xml.ex       source
emacsen-remove.ex   menu.ex              watch.ex
emacsen-startup.ex  postinst.ex
gnujump.cron.d.ex   postrm.ex
\end{lstlisting}
\end{frame}

\begin{frame}[fragile=singleslide]{Paso a paso\ldots (2)}
\begin{itemize}
	\item Examine \texttt{debian/changelog}, \texttt{debian/rules},
\texttt{debian/control}\\ (completado automáticamente por \textbf{dh\_make})
		\hbr
	\item En \texttt{debian/control}:\\ \texttt{Build-Depends: debhelper (>= 7.0.50~),
autotools-dev}\\ Enumera las \textsl{dependencias de constucción} = paquetes
necesarios para construir el paquete
		\hbr
	\item Try to build the package as-is with \texttt{debuild} (thanks to \textbf{dh}
magic)
		\begin{itemize}
			\item Añada dependencias de construcción hasta que se puede construir
			\item Pista: utilice \texttt{apt-cache search} y \texttt{apt-file} para encontrar
los paquetes
			\item Ejemplo:
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
checking for sdl-config... no
checking for SDL - version >= 1.2.0... no
[...]
configure: error: *** SDL version 1.2.0 not found!
\end{lstlisting}
$\rightarrow$ Añada \textbf{libsdl1.2-dev} al campo «Build-Depends» e
instálelo.
		\hbr
	\item Mejor aún: utilice \textbf{pbuilder} para realizar la construcción en un
entorno limpio
		\end{itemize}
\end{itemize}
\end{frame}

\begin{frame}[fragile=singleslide]{Paso a paso\ldots (3)}
	\begin{itemize}
		\item Required build-dependencies are \texttt{libsdl1.2-dev, libsdl-image1.2-dev,
libsdl-mixer1.2-dev}

		\item Then, you will probably run into another error:
	\end{itemize}
	\begin{lstlisting}[basicstyle=\ttfamily\tiny]
	/usr/bin/ld: SDL_rotozoom.o: undefined reference to symbol 'ceil@@GLIBC_2.2.5'
	//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
	collect2: error: ld returned 1 exit status
	Makefile:376: recipe for target 'gnujump' failed
	\end{lstlisting}
	\begin{itemize}
		\item This problem is caused by bitrot: gnujump has not been adjusted following
linker changes.
		\item If you are using source format version \textbf{1.0}, you can directly change
upstream sources.
			\begin{itemize}
				\item Edit \texttt{src/Makefile.am} and replace
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
gnujump_LDFLAGS = $(all_libraries)
\end{lstlisting}
					by
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
gnujump_LDFLAGS = -Wl,--as-needed
gnujump_LDADD = $(all_libraries) -lm
\end{lstlisting}
				\item Then run \texttt{autoreconf -i}
			\end{itemize}
	\end{itemize}
\end{frame}

\begin{frame}[fragile=singleslide]{Step by step\ldots (4)}
\begin{itemize}
	\item If you are using source format version \textbf{3.0 (quilt)}, use
\texttt{quilt} to prepare a patch. (see
\url{https://wiki.debian.org/UsingQuilt})
\begin{itemize}
\item \texttt{export QUILT\_PATCHES=debian/patches}
\item \texttt{mkdir debian/patches}\\ \texttt{quilt new linker-fixes.patch}\\ 
\texttt{quilt add src/Makefile.am}\\
\hbr
\item Edit \texttt{src/Makefile.am} and replace
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
gnujump_LDFLAGS = $(all_libraries)
\end{lstlisting}
by
\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
gnujump_LDFLAGS = -Wl,--as-needed
gnujump_LDADD = $(all_libraries) -lm
\end{lstlisting}
\hbr
\item \texttt{quilt refresh}
	\hbr
	\item Since \texttt{src/Makefile.am} was changed, autoreconf must be called during
the build. To do that automatically with \texttt{dh}, change the \texttt{dh}
call in \texttt{debian/rules} from: \texttt{dh \$\@ -{}-with
autotools-dev}\\ to: \texttt{dh \$\@ -{}-with autotools-dev -{}-with
autoreconf}
		\hbr
\end{itemize}
\end{itemize}
\end{frame}


\begin{frame}[fragile=singleslide]{Step by step\ldots (5)}
\begin{itemize}
	\item The package should now build fine.
		\hbr
	\item Use \texttt{debc} to list the content of the generated package, and
\texttt{debi} to install it and test it.
		\hbr
	\item Pruebe el paquete con \texttt{lintian}
		\begin{itemize}
			\item While not a strict requirement, it is recommended that packages uploaded to
Debian are \textsl{lintian-clean}
		\hbr
			\item More problems can be listed using \texttt{lintian -EviIL +pedantic}
		\hbr
			\item Some hints:
				\begin{itemize}
					\item Elimine los ficheros que no necesita en \texttt{debian/}
		\hbr
					\item Fill in \texttt{debian/control}
						\hbr
					\item Install the executable to \texttt{/usr/games} by overriding
\texttt{dh\_auto\_configure}
		\hbr
					\item Use \textsl{hardening} compiler flags to increase security.\\ See
\url{https://wiki.debian.org/Hardening}
				\end{itemize}
		\end{itemize}
\end{itemize}
\end{frame}

\begin{frame}{Step by step\ldots (6)}
		\begin{itemize}
	\item Compare su  paquete con el que existe en Debian:
		\begin{itemize}
			\item Separa los ficheros de datos en un segundo paquete, que es idéntico en todas
las arquitecturas ($\rightarrow$ ahorra espacio en el archivo de Debian)
				\hbr
			\item Instala un fichero «.desktop» (para los menús de GNOME/KDE) y también se
integra en el menú de Debian
				\hbr
			\item Arregla algunos problemas pequeños utilizando parches
		\end{itemize}
\end{itemize}
\end{frame}

\subsection{Ejercicio práctico 3: empaquetar una biblioteca de Java}
\begin{frame}{Ejercicio práctico 3: empaquetar una biblioteca de Java}
\begin{enumerate}
	\item Consulte brevemente la documentación sobre creación de paquetes de Java:\\
		\begin{itemize}
		\item \url{https://wiki.debian.org/Java}
      \hbr
		\item \url{https://wiki.debian.org/Java/Packaging}
      \hbr
		\item \url{https://www.debian.org/doc/packaging-manuals/java-policy/}
      \hbr
		\item \texttt{/usr/share/doc/javahelper/tutorial.txt.gz}
		\end{itemize}
		\br
	\item Descargue IRClib desde \url{http://moepii.sourceforge.net/}
		\br
	\item Empaquételo
\end{enumerate}
\end{frame}

\begin{frame}{Paso a paso\ldots}
\begin{itemize}
	\item \texttt{apt-get install javahelper}
		\hbr
	\item Cree un paquete fuente básico: \texttt{jh\_makepkg}
		\begin{itemize}
			\item Biblioteca
			\item Ninguno
			\item Compilador y sistema de tiempo de ejecución libre predefinido
		\end{itemize}
		\hbr
	\item Compruebe y modifique \texttt{debian/*}
		\hbr
	\item \texttt{dpkg-buildpackage -us -uc} o \texttt{debuild}
		\hbr
	\item \texttt{lintian}, \texttt{debc}, etc.
		\hbr
	\item Compare sus resultados con el paquete fuente \texttt{libirclib-java}
\end{itemize}
\end{frame}

\subsection{Ejercicio práctico 4: empaquetar un «gem» de Ruby}
\begin{frame}{Ejercicio práctico 4: empaquetar un «gem» de Ruby}
\begin{enumerate}
	\item Consulte brevemente la documentación sobre creación de paquetes de Ruby:\\
		\begin{itemize}
		\item \url{https://wiki.debian.org/Ruby}
      \hbr
		\item \url{https://wiki.debian.org/Teams/Ruby}
      \hbr
		\item \url{https://wiki.debian.org/Teams/Ruby/Packaging}
      \hbr
		\item \texttt{gem2deb(1)}, \texttt{dh\_ruby(1)} (en el paquete \texttt{gem2deb})
		\end{itemize}
		\hbr
	\item Create a basic Debian source package from the \texttt{peach} gem:\\ 
\texttt{gem2deb peach}
	\hbr
	\item Modifíquelo para que sea un paquete de Debian adecuado
\end{enumerate}
\end{frame}

\begin{frame}{Paso a paso\ldots}
\texttt{gem2deb peach}:
\begin{itemize}
\item Descarga el fichero «gem» de rubygems.org
\item Genera un archivo «.orig.tar.gz» adecuado, y descomprime el archivo tar
\item Inicia una paquete fuente de Debian en base o los metadatos del «gem»
	\begin{itemize}
		\item Se denomina \texttt{ruby-\textsl{gemname}}
	\end{itemize}
\item Intenta construir un paquete binario de Debian (puede fallar)
\end{itemize}
\br
\texttt{dh\_ruby} (incluido en \textsl{gem2deb}) realiza las tareas
específicas de Ruby:
\begin{itemize}
	\item Genera extensiones C para cada versión de Ruby
	\item Copia ficheros a su directorio de destino
	\item Actualiza los «shebang» de los scripts ejecutables
	\item Run tests defined in \texttt{debian/ruby-tests.rb},
\texttt{debian/ruby-tests.rake}, or \texttt{debian/ruby-test-files.yaml}, as
well as various other checks
\end{itemize}
\end{frame}

\begin{frame}[fragile=singleslide]{Paso a paso\ldots (2)}
Mejore el paquete generado:
\begin{itemize}
	\item Ejecute \texttt{debclean} para limpiar el árbol de fuentes. Compruebe
\texttt{debian/}.
		\hbr
	\item \texttt{changelog} y \texttt{compat} deben ser correctas
		\hbr
	\item Edit \texttt{debian/control}: improve \texttt{Description}
		\hbr
	\item Cree un fichero \texttt{copyright} adecuado basado en los ficheros del
desarrollador original
		\hbr
	\item Construya el paquete
		\hbr
	\item Compare your package with the \texttt{ruby-peach} package in the Debian
archive
\end{itemize}
\end{frame}

\subsection{Practical session 5: packaging a Perl module}
\begin{frame}[fragile=singleslide]{Practical session 5: packaging a Perl module}
\begin{enumerate}
	\item Take a quick look at some documentation about Perl packaging:\\
		\begin{itemize}
		\item \url{https://perl-team.pages.debian.net}
      \hbr
		\item \url{https://wiki.debian.org/Teams/DebianPerlGroup}
      \hbr
		\item \texttt{dh-make-perl(1)}, \texttt{dpt(1)} (in the \texttt{pkg-perl-tools}
package)
		\end{itemize}
		\hbr
	\item Create a basic Debian source package from the \texttt{Acme} CPAN
distribution:\\ \verb|dh-make-perl --cpan Acme|
	\hbr
	\item Modifíquelo para que sea un paquete de Debian adecuado
\end{enumerate}
\end{frame}

\begin{frame}[fragile=singleslide]{Paso a paso\ldots}
\verb|dh-make-perl --cpan Acme|:
\begin{itemize}
\item Downloads the tarball from the CPAN
\item Creates a suitable .orig.tar.gz archive, and untars it
\item Initializes a Debian source package based on the distribution's metadata
	\begin{itemize}
		\item Named \texttt{lib\textsl{distname}-perl}
	\end{itemize}
\end{itemize}
\end{frame}

\begin{frame}[fragile=singleslide]{Paso a paso\ldots (2)}
Mejore el paquete generado:
\begin{itemize}
	\item \texttt{debian/changelog}, \texttt{debian/compat},
\texttt{debian/libacme-perl.docs}, and \texttt{debian/watch} should be
correct
		\hbr
	\item Edit \texttt{debian/control}: improve \texttt{Description}, and remove
boilerplate at the bottom
		\hbr
	\item Edit \texttt{debian/copyright}: remove boilerplate paragraph at the top, add
years of copyright to the \texttt{Files:\hspace{0.3em}*} stanza
\end{itemize}
\end{frame}


\section*{Traducción}
\begin{frame}{Traducción}
 Omar Campagne Polaino
 \hbr

 Si encuentra algún error de traducción en la documentación, envíe un correo a
 \href{mailto:debian-l10n-spanish@lists.debian.org}{\texttt{<debian-l10n-spanish@lists.debian.org>}}.
\end{frame}
\end{document}